Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#3025 closed enhancement (fixed)

[patch] Newforms - auto_id

Reported by: Chris Beaven Owned by: Adrian Holovaty
Component: contrib.admin Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

auto_id is a property for Forms. Off by default, set it as a string with a %s (such as 'id_%s' to match the oldforms format) to make the forms widgets use an id by default. You can retrieve a BoundFields auto id value via it's property auto_id.

Attachments (2)

newforms_autoid.patch (1.3 KB ) - added by Chris Beaven 18 years ago.
newforms_autoid.2.patch (1.4 KB ) - added by Chris Beaven 18 years ago.
sigh... save first, then patch…

Download all attachments as: .zip

Change History (5)

by Chris Beaven, 18 years ago

Attachment: newforms_autoid.patch added

by Chris Beaven, 18 years ago

Attachment: newforms_autoid.2.patch added

sigh... save first, then patch...

comment:1 by Chris Beaven, 18 years ago

This also adds a helpful property pretty_name to BoundField so that templates can get the pretty name directly.

comment:2 by Adrian Holovaty, 18 years ago

Resolution: fixed
Status: newclosed

(In [4073]) Fixed #3025 -- Added auto_id option to Form.init(). Thanks, SmileyChris

comment:3 by Adrian Holovaty, 18 years ago

For the record, I made auto_id an argument to Form.__init__() rather than making it a class attribute so that it wouldn't prevent people from using a field named auto_id.

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