Add additional properties to the choices attribute in field class for Form objects
The ChoiceField class has an attribute choices which takes a list of 2 element tuple by default.
self.field[<field name>].choices = ([
This blueprint describes a way to extend this to define additional properties or attributes for each choice within the choices list. These additional attributes for each choice can be any HTML global attributes defined in a dictionary. For example, to define a help text for each choice:
self.field[<field name>].choices = ([
Blueprint information
- Status:
- Complete
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- mariam john
- Direction:
- Needs approval
- Assignee:
- mariam john
- Definition:
- Approved
- Series goal:
- None
- Implementation:
- Implemented
- Milestone target:
- None
- Started by
- Rob Cresswell
- Completed by
- Rob Cresswell
Related branches
Related bugs
Sprints
Whiteboard
Gerrit topic: https:/
Addressed by: https:/
Add attributes to cell in a table depending on data
Addressed by: https:/
Add additional attributes to choices in ChoiceField