#33714: Better admin support for ArrayFields where the base_field has choices
-----------------------------------------+------------------------
Reporter: Jaap Roes | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: dev
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
Currently the admin doesn't really work well when registering a model that
has a ArrayField of which the base_field has choices e.g.:
{{{
class Post(model.Model):
category = ArrayField(
models.CharField(choices=[
('FASHION', 'Fashion'),
('STYLE', 'Style'),
('SPORTS', 'Sports'),
('FUN', 'Fun'),
], max_length=8),
size=2,
blank=True,
default=list
)
}}}
For example, the edit form uses a simple text input to edit the choices
instead of a `MultipleChoiceField`. Adding the field to `list_display`
will show the raw values, not the display names. Adding the field to
`list_filter` will only show filter options of combinations used in the
database (stringified arrays).
--
Ticket URL: <https://code.djangoproject.com/ticket/33714>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070180d261709c-5142672b-c1f9-409a-8566-00126612e174-000000%40eu-central-1.amazonses.com.