#19175: contrib/admin giving duplicate option in select box for unique declared
m2m
relationship
-------------------------------+--------------------
Reporter: txomon | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 1.4
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+--------------------
Hi,
I have been testing django's admin interface, and I detected a "bug".
I am using the attached code.
There are several problems, or what I think they are bugs.
In first place, I used an inline in the admin.py to make the m2m appear in
the interface. I am using through for personal reasons.
When you launch the app, (you can actually do ./manage.py syncdb &&
./manage.py runserver) and have a person, and start to add instruments,
you will notice that you can select two times the same (thought the
unique_together property in the Relationship models).
In my opinion, that shouldn't be happening, as if you have marked it as
unique, once selected, shouldn't give possibility to introduce once more
that value. So I would ask for updating the widget (I am told that this is
called like that) to dinamically update the select boxes to avoid giving
duplicates option in unique m2m relationships. Screenshot attached.
When I saw that, I tried then to solve this by putting in the admin,py
PersonAdmin, InstrumentAdmin, etc. the filter_horizontal property for
making imposible with that method to insert duplicates. And I found that
Instruments didn't had the reverse dependency. I asked in #django which
was the name of the reverse dependency field (and also checked in shell)
that it was named person_set (in Instrument, Post and Email).
I putted a line in each ModelAdmin to make a filter_horizontal for those
fields, but it failed to recognise the person_set in the reversed ones.
Don't doubt asking me to explain once more or give details if you don't
understand me.
--
Ticket URL: <https://code.djangoproject.com/ticket/19175>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.