Added tooltips (title=) to newforms.widgets.Select
|Reported by:||Owned by:||Adrian Holovaty|
|Cc:||Triage Stage:||Design decision needed|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
It is useful to have tooltips in dropdown list.
So I created a SelectWTitle widget, that processes third choice's item value as an option title. I also fixed newforms.fields.py to process three-values items.
I'm not sure in widget's name - maybe there's a better name for it.
>>> AgentForm(newforms.Form): record_type = forms.ChoiceField(widget=SelectWTitle, choices=[('agname', 'Agent name', 'Name of the agent that makes the action')]) >>> print AgentForm() <select> <option value='agname' title='Name of the agent that makes the action'>Agent name</option> </select>
Change History (3)
comment:1 Changed 10 years ago by
|Patch needs improvement:||unset|
|Summary:||Added toottips (title=) to newforms.widgets.Select → Added tooltips (title=) to newforms.widgets.Select|
|Triage Stage:||Unreviewed → Design decision needed|