#26352: models.E003 check incorrectly prevents duplicate ManyToMany through-self
that differ by through_fields
-------------------------------------+-------------------------------------
Reporter: simonw | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.9
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by simonw):
As Simon Charette pointed out in a comment on the pull request, this may
not be necessary. In the above example the same effect can be achieved
using the related_name property, like this:
{{{#!python
class User(models.Model):
friends = models.ManyToManyField(
'self', through='Followship', symmetrical=False,
through_fields=('user', 'target'),
related_name='followers'
)
}}}
In which case, is there a real world use-case in which it's useful to be
able to specify multiple ManyToManyFields in the way proposed by this
ticket?
--
Ticket URL: <https://code.djangoproject.com/ticket/26352#comment:2>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.4c3a7240d919fa2d962389d5fc559d47%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.