Django

Code

Ticket #3557 (closed: fixed)

Opened 2 years ago

Last modified 1 year ago

SlugField not correctly autopopulated / has no max_length

Reported by: Russell Cloran <russell@rucus.net> Assigned to: adrian
Milestone: Component: Forms
Version: newforms-admin Keywords: newforms newforms-admin slugfield
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

The SlugField? returns a forms.CharField?, but does not set the max_length attribute.

That means that in newforms-admin auto-population of the field doesn't work. As well as many other Bad Things.

I think that subclassing the CharField? is the way to go here. If not, the alternative method (copy-paste bits out of the CharField? class) is also a trivial patch.

Attachments

slugfield.patch (1.0 kB) - added by Russell Cloran <russell@rucus.net> on 02/23/07 13:33:00.
Patch to fix SlugField? in newforms
slugfield.2.patch (9.9 kB) - added by Russell Cloran <russell@rucus.net> on 02/24/07 00:40:37.
Patch to fix SlugField? in newforms. Incl new tests.

Change History

02/23/07 13:33:00 changed by Russell Cloran <russell@rucus.net>

  • attachment slugfield.patch added.

Patch to fix SlugField? in newforms

02/23/07 16:24:27 changed by Simon G. <dev@simon.net.nz>

  • needs_better_patch changed.
  • component changed from Uncategorized to django.newforms.
  • needs_tests changed.
  • owner changed from jacob to adrian.
  • needs_docs changed.
  • stage changed from Unreviewed to Accepted.

02/24/07 00:40:37 changed by Russell Cloran <russell@rucus.net>

  • attachment slugfield.2.patch added.

Patch to fix SlugField? in newforms. Incl new tests.

04/08/07 05:02:33 changed by Russell Cloran <russell@rucus.net>

  • keywords changed from newforms-admin slugfield to newforms newforms-admin slugfield.
  • version changed from newforms branch to SVN.

09/06/07 22:17:24 changed by Brian Rosner <brosner@gmail.com>

Just as a point of reference it looks like r6056 in newforms-admin solved this. Once that branch gets merged in this ticket can be closed.

09/07/07 06:44:00 changed by Russell Cloran <russell@rucus.net>

  • version changed from SVN to newforms-admin.

This should not be closed without the regression tests being committed.

09/08/07 00:09:39 changed by gwilson

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

(In [6065]) Fixed #3557 -- Made SlugField inherit from CharField so that its max_length is properly set. Removed get_manipulator_field_objs method since it's already provided by CharField. Thanks, Russell Cloran.


Add/Change #3557 (SlugField not correctly autopopulated / has no max_length)




Change Properties
Action