Opened 15 years ago

Closed 14 years ago

#13728 closed (invalid)

Incorrect default value for verify_exists in URLField documentation

Reported by: Mark Tran Owned by: Satoru Logic
Component: Documentation Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

The Django documentation states that the default value for the keyword argument "verify_exists" is True:

http://docs.djangoproject.com/en/dev/ref/models/fields/#urlfield

http://code.djangoproject.com/browser/django/trunk/docs/ref/models/fields.txt#L799

I've noticed that the default value is actually False:

http://code.djangoproject.com/browser/django/trunk/django/forms/fields.py#L532

In [1]: from django import forms
In [2]: url = forms.URLField()
In [3]: url.validators[0].verify_exists
Out[3]: False

Attachments (1)

13728_correct_default_value.diff (1.9 KB ) - added by Satoru Logic 15 years ago.
Default values are set according to the document and some changes are made to other code to pass pylint check

Download all attachments as: .zip

Change History (4)

comment:1 by Satoru Logic, 15 years ago

Owner: changed from nobody to Satoru Logic
Status: newassigned

by Satoru Logic, 15 years ago

Default values are set according to the document and some changes are made to other code to pass pylint check

comment:2 by Russell Keith-Magee, 15 years ago

Has patch: set
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

When the implemenation has existed as-is for as long as it has, we fix the documentation, not the code. Changing the code would be backwards incompatible for anyone using (and relying on) the existing implementation.

comment:3 by Tim Graham, 14 years ago

Resolution: invalid
Status: assignedclosed

Actually this is documented correctly. The default for form fields is False, but the default for model fields is True.

>>> from django.db import models
>>> models.URLField().validators
[<django.core.validators.MaxLengthValidator object at 0x27d34d0>, <django.core.validators.URLValidator object at 0x27d3510>]
<django.core.validators.URLValidator object at 0x27d3490>
>>> models.URLField().validators[1].verify_exists
True
Note: See TracTickets for help on using tickets.
Back to Top