Opened 20 years ago
Closed 20 years ago
#414 closed defect (invalid)
radio_admin doesn't appear to work
| Reported by: | Owned by: | Adrian Holovaty | |
|---|---|---|---|
| Component: | Metasystem | Version: | |
| Severity: | normal | Keywords: | radio_admin radio admin manytomany select |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
I posted this to the groups, but didn't get a response. Perhaps nobody uses radio_admin. I have a need to display my many-to-many as a list of checkboxes...both in the admin UI and user forms.
I've done the following:
meta.ManyToManyField(DayToHelp, radio_admin=True,
blank=True, null=True),
yet, I get a select list everywhere I try to reference that field.
Should I expect this to work for user forms, too?
The current way would *almost* not be a problem, as I can just do this
in my form:
<ul style="list-style: none;" id="daystohelp">
{% for choice in form.manipulator.daytohelps.choices %}
<li>
<input type="checkbox" name="daytohelps" value="{{ choice.0 }}"/>
{{ choice.1 }}
</li>
{% endfor %}
</ul>
However, it doesn't retain the selection when there's an error like it
does for the rest of the fields.
radio_admin=Trueapplies to the admin, not to any custom code that you might write.