Opened 19 years ago

Closed 18 years ago

Last modified 17 years ago

#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)

urlfield_maxlength.diff (816 bytes ) - added by Julien Poissonnier <poissonnier@…> 19 years ago.
add maxlength argument to URLField
URLField-db-maxlength.diff (3.3 KB ) - added by Robert Bunting 18 years ago.
adds db backend support for URLField maxlength
URLField-db-maxlength-4293.diff (3.4 KB ) - added by mcroydon 18 years ago.
Updated to apply cleanly against trunk [4293]

Download all attachments as: .zip

Change History (16)

by Julien Poissonnier <poissonnier@…>, 19 years ago

Attachment: urlfield_maxlength.diff added

add maxlength argument to URLField

comment:1 by Julien Poissonnier <poissonnier@…>, 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 anonymous, 19 years ago

milestone: Version 0.91Version 0.93
Type: defectenhancement

comment:3 by Matt McClanahan, 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 Adrian Holovaty, 19 years ago

Resolution: fixed
Status: newclosed

(In [2874]) Fixed #1477 -- Made maxlength overridablef for URLField formfield

comment:5 by Adrian Holovaty, 18 years ago

milestone: Version 0.93

Milestone Version 0.93 deleted

by Robert Bunting, 18 years ago

Attachment: URLField-db-maxlength.diff added

adds db backend support for URLField maxlength

comment:6 by Robert Bunting <robert@…>, 18 years ago

Resolution: fixed
Status: closedreopened

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 Gary Wilson <gary.wilson@…>, 18 years ago

Cc: gary.wilson@… 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: enhancementdefect

by mcroydon, 18 years ago

Updated to apply cleanly against trunk [4293]

comment:8 by mcroydon, 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 mcroydon, 18 years ago

To clarify, the only test that is failing was already failing before applying this patch.

comment:10 by Jacob, 18 years ago

Resolution: fixed
Status: reopenedclosed

(In [4295]) Fixed #1477: URLFields now accept a maxlength parameter. Thanks, Matt Croydon.

in reply to:  description comment:11 by 1477, 17 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.

in reply to:  5 comment:12 by anonymous, 17 years ago

Replying to adrian:

Milestone Version 0.93 deleted

comment:13 by anonymous, 17 years ago

mnömçöçmöç

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