Fixed #12203 -- Allow using ManyToManyField with through in Admin.#18612
Fixed #12203 -- Allow using ManyToManyField with through in Admin.#18612RosanaRufer wants to merge 1 commit intodjango:mainfrom
Conversation
The description of https://code.djangoproject.com/ticket/9475 says:
So a non-null field could theoretically be fine as long as it gets filled by the model's Similar to ticket 9475, I'd suggest just letting the db error be raised at runtime. I don't think it's really possible for the checks to figure out if it's going to be an issue or not without looking at the code. But I might be wrong. |
|
is there a way to know when this is going to be merged? |
Hello @agas0077, thank you for your interest in this PR, and thank you @RosanaRufer and @collinanderson for getting started in this work. I will add some comments after a quick initial review pass:
Because of the above, I'll set the ticket as needs docs, needs tests and needs improvement. When the changes above are addressed, each flag should be unset in the ticket. Once the above is completed, members of the Review and Triage team will provide a more in depth review of the proposal. |
Trac ticket number
ticket-12203
Branch description
Closing ticket 12203 - Making it possible to define custom through models as Admin fields.
Extended description
Checklist
Context
Took @collinanderson 's work, tested the solution and works great with a basic through model.
This solution removes the check that prevents setting an m2m field in ModelAdmin.fields, when the field was configured with a custom
throughmodel. We wondered if it'd make sense to remove this check only when thethroughmodel isn't exactly like the one that would be autogenerated by Django but we don't think it's really possible for the checks to figure out if it's going to be an issue or not without executing the operation, if you know a way, please share.