Opened 7 years ago

Last modified 7 years ago

#28059 closed Bug

Admin page cannot render horizontal radio buttons — at Version 2

Reported by: Musen Owned by: Musen
Component: contrib.admin Version: 1.11
Severity: Release blocker Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Musen)

To reproduce the bug, suppose we have the model Person defined in models.py

class Person(Models.model):
    age = CharField(choices = (('Y', 'Young'), ('O', 'Old')))

We want to display the choice of age in our admin change page in radio buttons, so we have the following codes in admin.py

from .models import Person

class PersonAdmin(admin.ModelAdmin):
    radio_fields = {'age': admin.HORIZONTAL}

admin.site.register(Person, PersonAdmin)

Then, we will get the vertical radio buttons instead of the horizontal ones.

Change History (2)

comment:1 by Musen, 7 years ago

Owner: changed from nobody to Musen
Status: newassigned

comment:2 by Musen, 7 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top