Code

Opened 7 years ago

Closed 7 years ago

#4237 closed (wontfix)

newforms form_for_model ignores radio_admin

Reported by: Robert Myers <myer0052@…> Owned by: nobody
Component: Forms Version: master
Severity: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Building off of ticket #3268 if you specify radio_admin=True the newforms form_for_model shortcut should display the field as a radioselect field.

Attachments (2)

radio_select.diff (843 bytes) - added by Robert Myers <myer0052@…> 7 years ago.
use RadioSelect widget if radio_admin=True
radio_select_with_tests.diff (5.7 KB) - added by Robert Myers <myer0052@…> 7 years ago.
Patch now with tests and documentation.

Download all attachments as: .zip

Change History (9)

Changed 7 years ago by Robert Myers <myer0052@…>

use RadioSelect widget if radio_admin=True

comment:1 Changed 7 years ago by Robert Myers <myer0052@…>

  • Component changed from Uncategorized to django.newforms
  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Owner changed from jacob to adrian
  • Patch needs improvement unset

comment:2 Changed 7 years ago by SmileyChris

  • Needs tests set
  • Triage Stage changed from Unreviewed to Accepted

Seems fair enough. Just needs some tests.

Changed 7 years ago by Robert Myers <myer0052@…>

Patch now with tests and documentation.

comment:3 Changed 7 years ago by SmileyChris

  • Needs tests unset
  • Triage Stage changed from Accepted to Ready for checkin

Looks good

comment:4 Changed 7 years ago by mtredinnick

  • Resolution set to wontfix
  • Status changed from new to closed

No, we don't want to do this. It's adding an attribute to model fields that is only for presentational control. Presentation information does not belong in data models.

If you want this sort of control and still want to use form_for_model(), then use the formfield_callback attribute to control things.

comment:5 Changed 7 years ago by SmileyChris

  • Resolution wontfix deleted
  • Status changed from closed to reopened

Maybe I'm missing something, but radio_admin is already an attribute of model fields:
http://www.djangoproject.com/documentation/model-api/#radio-admin

What's the attribute getting added?

comment:6 Changed 7 years ago by mtredinnick

  • Triage Stage changed from Ready for checkin to Design decision needed

Logically, radio_admin should go away in newforms-admin. Just like prepopulate_from, it only exists for admin presentational purposes. Adding in a new feature that depends on it will mean people get attached to (and write code that depends on) a feature that should be on death row.

Still inclined to wontfix, but I'll "design decision" it for the time being and worry about it later.

comment:7 Changed 7 years ago by ubernostrum

  • Resolution set to wontfix
  • Status changed from reopened to closed

Agreeing with Malcolm, but going ahead with the wontfix; the "radio_admin" feature is going away.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.