Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#9713 closed (wontfix)

No verification of URL validity on django.db.models.fields.URLField

Reported by: Masklinn Owned by: nobody
Component: Documentation Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The documentation for URLField states, for the verify_exists kwarg, If True (the default), the URL given will be checked for existence (i.e., the URL actually loads and doesn't give a 404 response).

But this validation doesn't seem to happen and, indeed, nothing in the URLField code performs any verification of the URL's validity.

The forms URLField on the other hand does perform URL verification and validation on verify_exists.

I'm not sure whether it's a case of overreaching documentation or of something that wasill be checked for existence (i.e., the URL actually loads and doesn't give a 404 response).

But this validation doesn't seem to happen and, indeed, nothing in the URLField code performs any verification of the URL's validity.

The forms URLField on the other hand does perform URL verification and validation on verify_exists as documented.

I'm not sure whether it's a case of overreaching documentation or of something that was supposed to be included in t supposed to be included in the code but wasn't or was removed, so I marked this as a doc bug.

Change History (4)

comment:1 by James Bennett, 15 years ago

Resolution: invalid
Status: newclosed

Model fields don't currently perform any sort of validation; form fields generated from them do. Hence, a form generated from your model will include the validation for the URLField.

comment:2 by Masklinn, 15 years ago

Resolution: invalid
Status: closedreopened

I have no problem with that, but the documentation is still wrong as it clearly implies that the model itself will perform the validation, without saying that one has to use an intermediate form.

comment:3 by James Bennett, 15 years ago

Resolution: wontfix
Status: reopenedclosed

Noting every place where a constraint is only handled at the form level would create too many spurious documentation changes for no good reason, especially since model-level validation is slated for inclusion in the Django 1.1 release.

comment:4 by (none), 15 years ago

milestone: post-1.0

Milestone post-1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top