Opened 18 years ago

Closed 18 years ago

#4003 closed (wontfix)

Added tooltips (title=) to newforms.widgets.Select

Reported by: tonnzor <tonn81@…> Owned by: Adrian Holovaty
Component: Forms Version: dev
Severity: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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.

Usage example:

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

Attachments (1)

SelectWTitle.diff (1.7 KB ) - added by tonnzor <tonn81@…> 18 years ago.

Download all attachments as: .zip

Change History (3)

by tonnzor <tonn81@…>, 18 years ago

Attachment: SelectWTitle.diff added

comment:1 by Chris Beaven, 18 years ago

Summary: Added toottips (title=) to newforms.widgets.SelectAdded tooltips (title=) to newforms.widgets.Select
Triage Stage: UnreviewedDesign decision needed

Not really my cup of tea, but I'll leave it to core devs to decide.

comment:2 by Malcolm Tredinnick, 18 years ago

Resolution: wontfix
Status: newclosed

Not worth including in core. Best practice is that select names should be descriptive enough on their own. You might want to post it to Django snippets, though, for people who would find this useful.

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