Opened 4 months ago
Last modified 4 months ago
#36365 closed Bug
Admin filter_horziontal with formfield_for_manytomany hides existing records — at Version 1
Reported by: | Ramon | Owned by: | |
---|---|---|---|
Component: | contrib.admin | Version: | 4.2 |
Severity: | Normal | Keywords: | admin, filter_horizontal |
Cc: | Ramon | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
Django admin filter_horizontal for manytomany field should show all existing relations in the right-side pane, even when formfield_for_manytomany updates the queryset to not show that relation in the left-side pane. It is misleading to the user to not show the existing relation.
Working example attached (example.zip).
Database: club, member, team.
member and team belong to one club
team consists of members
member can transfer to another club, causing the issue.
admin.py contains two versions of the team admin model (1 and 2)
Screenshots for each admin model usage are attached.
Change History (4)
by , 4 months ago
Attachment: | example.zip added |
---|
by , 4 months ago
Attachment: | screenshot_admin_1.png added |
---|
by , 4 months ago
Attachment: | screenshot_admin_2.png added |
---|
comment:1 by , 4 months ago
Description: | modified (diff) |
---|