#897: Bi-Directional ManyToMany in Admin -------------------------------+------------------------------------ Reporter: anonymous | Owner: nobody Type: New feature | Status: new Component: contrib.admin | Version: Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------+------------------------------------
Comment (by rhunwicks): Using Django 1.5.1 I was getting: {{{ app.test1: Reverse query name for m2m field 'tests2' clashes with m2m field 'Test2.tests1'. Add a related_name argument to the definition for 'tests2' }}} This is almost certainly because my field and model name is the same. Either way, I have solved it by adding `related_name` to `Test1.tests2` and taking the opportunity to suppress it from `Test2`: {{{ class Test1(models.Model): tests2 = models.ManyToManyField('Test2', related_name='test2_set+', blank=True) class Test2(models.Model): tests1 = models.ReverseManyToManyField(Test1, through=Test1.tests2.through, blank=True) }}} -- Ticket URL: <https://code.djangoproject.com/ticket/897#comment:30> 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 django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.