#1477 closed defect (fixed)
[patch] URLField is limited to a maxlength of 200
Reported by: | favo | Owned by: | Adrian Holovaty |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | normal | Keywords: | |
Cc: | gary.wilson@… | Triage Stage: | Unreviewed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
URLField is limit to 200 maxlenght, and not expose a agrument to change, hope that fix in next version of Django.
Attachments (3)
Change History (16)
by , 19 years ago
Attachment: | urlfield_maxlength.diff added |
---|
comment:1 by , 19 years ago
Note: the attached patch is for the magic-removal branch. I've never used another Django version so I am not sure if this works for other versions.
comment:2 by , 19 years ago
milestone: | Version 0.91 → Version 0.93 |
---|---|
Type: | defect → enhancement |
comment:3 by , 19 years ago
Summary: | URLField is limit to 200 maxlenght, and not expose a agrument to change → [patch] URLField is limit to 200 maxlenght, and not expose a agrument to change |
---|
Adding [patch] to summary
comment:4 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
by , 18 years ago
Attachment: | URLField-db-maxlength.diff added |
---|
adds db backend support for URLField maxlength
comment:6 by , 18 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
r2874 made the formfield handle maxlength properly, but the db backends still hardcoded a length of 200 for URLField. So your form would allow >200 chars, but the generated sql for the database still created a field of 200 chars.
The above patch fixes this (URLField subclasses CharField much like EmailField does, but has maxlength definable like SlugField). Of course, this would also allow you to save space by using shorter URLFields if you knew you were able to.
comment:7 by , 18 years ago
Cc: | added |
---|---|
Summary: | [patch] URLField is limit to 200 maxlenght, and not expose a agrument to change → [patch] URLField is limited to a maxlength of 200 |
Type: | enhancement → defect |
by , 18 years ago
Attachment: | URLField-db-maxlength-4293.diff added |
---|
Updated to apply cleanly against trunk [4293]
comment:8 by , 18 years ago
I'm not aware of any side effects this change might have, but the only test I can get to fail after applying this patch is completely unreleated to URLFields.
comment:9 by , 18 years ago
To clarify, the only test that is failing was already failing before applying this patch.
comment:10 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:11 by , 18 years ago
Replying to favo:
URLField is limit to 200 maxlenght, and not expose a agrument to change, hope that fix in next version of Django.
add maxlength argument to URLField