Opened 10 years ago

Closed 10 years ago

Last modified 10 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: UI/UX:

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 10 years ago.
newforms_autoid.2.patch (1.4 KB) - added by Chris Beaven 10 years ago.
sigh... save first, then patch…

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by Chris Beaven

Attachment: newforms_autoid.patch added

Changed 10 years ago by Chris Beaven

Attachment: newforms_autoid.2.patch added

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

comment:1 Changed 10 years ago by Chris Beaven

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

comment:2 Changed 10 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

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

comment:3 Changed 10 years ago by Adrian Holovaty

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