Opened 10 years ago

Closed 9 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@…> 10 years ago.
use RadioSelect widget if radio_admin=True
radio_select_with_tests.diff (5.7 KB) - added by Robert Myers <myer0052@…> 10 years ago.
Patch now with tests and documentation.

Download all attachments as: .zip

Change History (9)

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

Attachment: radio_select.diff added

use RadioSelect widget if radio_admin=True

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

Component: Uncategorizeddjango.newforms
Has patch: set
Owner: changed from Jacob to Adrian Holovaty

comment:2 Changed 10 years ago by Chris Beaven

Needs tests: set
Triage Stage: UnreviewedAccepted

Seems fair enough. Just needs some tests.

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

Patch now with tests and documentation.

comment:3 Changed 10 years ago by Chris Beaven

Needs tests: unset
Triage Stage: AcceptedReady for checkin

Looks good

comment:4 Changed 10 years ago by Malcolm Tredinnick

Resolution: wontfix
Status: newclosed

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 10 years ago by Chris Beaven

Resolution: wontfix
Status: closedreopened

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 10 years ago by Malcolm Tredinnick

Triage Stage: Ready for checkinDesign 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 9 years ago by James Bennett

Resolution: wontfix
Status: reopenedclosed

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

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