--
Ticket URL: <https://code.djangoproject.com/ticket/32983>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* owner: nobody => partofthething
* status: new => assigned
Comment:
I have a PR that implements this incoming.
--
Ticket URL: <https://code.djangoproject.com/ticket/32983#comment:1>
* has_patch: 0 => 1
Comment:
https://github.com/django/django/pull/14730
--
Ticket URL: <https://code.djangoproject.com/ticket/32983#comment:2>
* needs_better_patch: 0 => 1
* stage: Unreviewed => Accepted
Comment:
OK, I guess we can do something here — it probably is a source of
confusion.
The same issue was raised in #18021 (but as an invalid bug report, rather
than suggesting improving the messaging).
Looking at the PR — I'm sceptical about just raising an error — this will
likely break code in the wild.
Can we investigate adding a system check here instead?
There are several similar checks for related fields already:
https://docs.djangoproject.com/en/3.2/ref/checks/#related-fields
--
Ticket URL: <https://code.djangoproject.com/ticket/32983#comment:3>
Comment (by Carlton Gibson):
Same issue **also** came up in #12641
--
Ticket URL: <https://code.djangoproject.com/ticket/32983#comment:4>
Comment (by Nick Touran):
Absolutely. A system check is a much better approach than my initial idea
of the error. I have changed the patch to use a system check.
--
Ticket URL: <https://code.djangoproject.com/ticket/32983#comment:5>
* needs_better_patch: 1 => 0
Comment:
Unchecking patch needs improvement as instructed on the page, (pending
reviewer acceptance of course).
--
Ticket URL: <https://code.djangoproject.com/ticket/32983#comment:6>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/32983#comment:7>
Comment (by Carlton Gibson <carlton@…>):
In [changeset:"1fb21ab3770bdc07fc847e131fa252759befadd2" 1fb21ab3]:
{{{
#!CommitTicketReference repository=""
revision="1fb21ab3770bdc07fc847e131fa252759befadd2"
Refs #32983 -- Removed unneeded related_name from test model definitions.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32983#comment:8>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"5d4f21b16f002ed5202a68d6977346ccf53b0b0e" 5d4f21b1]:
{{{
#!CommitTicketReference repository=""
revision="5d4f21b16f002ed5202a68d6977346ccf53b0b0e"
Fixed #32983 -- Added system check for redundant related_name on
symmetrical M2M fields.
Since ManyToManyFields defined with `symmetrical=True` do not add a
related field to the target model, including a `related_name` argument
will never do what the coder likely expects. This makes including
a related_name with a symmetrical model raise a system check warning.
ticket-32983
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32983#comment:9>