Opened 10 years ago

Last modified 7 years ago

#23604 closed Bug

Regression in allowing to handle M2M fields from the "receiving end" - follow up to #23329 — at Initial Version

Reported by: Emmanuelle Delescolle Owned by: nobody
Component: contrib.admin Version: 1.7
Severity: Release blocker Keywords: to_field_allowed, M2M
Cc: Simon Charette Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Up until Django 1.5.8 and Django 1.6.5 in was possible to have a ManyToMany field displayed in the admin on the "receiving-end" of the relationship with the ability to add new records.
Due to the restrictiveness of the new to_field_allowed method, one cannot open the popup for adding new records to the Model where the ManyToMany relationship is defined.

I realize this usage of the admin site is undocumented but, since the current code allows to perform that from the "receiving-end" of ForeignKey fields, IMHO it should also work for ManyToMany fields.

If the descriptions sounds too vague, see http://www.lasolution.be/blog/related-manytomanyfield-django-admin-site.html for a complete step-by-step explanation on how to reproduce.

Change History (2)

by Emmanuelle Delescolle, 10 years ago

Attachment: failing_test.patch added

Failing test (patch for master)

by Emmanuelle Delescolle, 10 years ago

Attachment: fix.patch added

Fix

Note: See TracTickets for help on using tickets.
Back to Top