Django

Code

Ticket #1477 (closed: fixed)

Opened 3 years ago

Last modified 1 year ago

[patch] URLField is limited to a maxlength of 200

Reported by: favo Assigned to: adrian
Milestone: Component: Database layer (models, ORM)
Version: SVN Keywords:
Cc: gary.wilson@gmail.com Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

URLField is limit to 200 maxlenght, and not expose a agrument to change, hope that fix in next version of Django.

Attachments

urlfield_maxlength.diff (0.8 kB) - added by Julien Poissonnier <poissonnier@gmail.com> on 03/08/06 04:07:52.
add maxlength argument to URLField
URLField-db-maxlength.diff (3.3 kB) - added by Robert Bunting on 11/07/06 22:55:01.
adds db backend support for URLField maxlength
URLField-db-maxlength-4293.diff (3.4 kB) - added by mcroydon on 01/05/07 22:30:01.
Updated to apply cleanly against trunk [4293]

Change History

03/08/06 04:07:52 changed by Julien Poissonnier <poissonnier@gmail.com>

  • attachment urlfield_maxlength.diff added.

add maxlength argument to URLField

03/08/06 04:17:38 changed by Julien Poissonnier <poissonnier@gmail.com>

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.

04/20/06 20:47:36 changed by anonymous

  • type changed from defect to enhancement.
  • milestone changed from Version 0.91 to Version 0.93.

05/09/06 00:43:41 changed by mattmcc

  • summary changed from URLField is limit to 200 maxlenght, and not expose a agrument to change to [patch] URLField is limit to 200 maxlenght, and not expose a agrument to change.

Adding [patch] to summary

05/09/06 11:04:04 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

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

(follow-up: ↓ 12 ) 10/24/06 15:17:34 changed by adrian

  • milestone deleted.

Milestone Version 0.93 deleted

11/07/06 22:55:01 changed by Robert Bunting

  • attachment URLField-db-maxlength.diff added.

adds db backend support for URLField maxlength

11/07/06 23:01:17 changed by Robert Bunting <robert@exoweb.net>

  • status changed from closed to reopened.
  • resolution deleted.

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.

11/09/06 08:29:44 changed by Gary Wilson <gary.wilson@gmail.com>

  • cc set to gary.wilson@gmail.com.
  • type changed from enhancement to defect.
  • summary changed from [patch] URLField is limit to 200 maxlenght, and not expose a agrument to change to [patch] URLField is limited to a maxlength of 200.

01/05/07 22:30:01 changed by mcroydon

  • attachment URLField-db-maxlength-4293.diff added.

Updated to apply cleanly against trunk [4293]

01/05/07 22:35:11 changed by mcroydon

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.

01/05/07 22:36:45 changed by mcroydon

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

01/08/07 14:28:32 changed by jacob

  • status changed from reopened to closed.
  • resolution set to fixed.

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

(in reply to: ↑ description ) 05/23/07 08:19:08 changed by 1477

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 ) 05/23/07 10:51:35 changed by anonymous

Replying to adrian:

Milestone Version 0.93 deleted

05/23/07 10:51:48 changed by anonymous

mnömçöçmöç


Add/Change #1477 ([patch] URLField is limited to a maxlength of 200)




Change Properties
Action