Opened 17 years ago

Closed 17 years ago

#3557 closed (fixed)

SlugField not correctly autopopulated / has no max_length

Reported by: Russell Cloran <russell@…> Owned by: Adrian Holovaty
Component: Forms Version: newforms-admin
Severity: Keywords: newforms newforms-admin slugfield
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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 (2)

slugfield.patch (1.0 KB ) - added by Russell Cloran <russell@…> 17 years ago.
Patch to fix SlugField in newforms
slugfield.2.patch (9.9 KB ) - added by Russell Cloran <russell@…> 17 years ago.
Patch to fix SlugField in newforms. Incl new tests.

Download all attachments as: .zip

Change History (7)

by Russell Cloran <russell@…>, 17 years ago

Attachment: slugfield.patch added

Patch to fix SlugField in newforms

comment:1 by Simon G. <dev@…>, 17 years ago

Component: Uncategorizeddjango.newforms
Owner: changed from Jacob to Adrian Holovaty
Triage Stage: UnreviewedAccepted

by Russell Cloran <russell@…>, 17 years ago

Attachment: slugfield.2.patch added

Patch to fix SlugField in newforms. Incl new tests.

comment:2 by Russell Cloran <russell@…>, 17 years ago

Keywords: newforms added
Version: newforms branchSVN

comment:3 by Brian Rosner <brosner@…>, 17 years ago

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.

comment:4 by Russell Cloran <russell@…>, 17 years ago

Version: SVNnewforms-admin

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

comment:5 by Gary Wilson, 17 years ago

Resolution: fixed
Status: newclosed

(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.

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