I tried out the example code, and can replicate this. What's interesting is that if I try removing the ContactConnection model, and the "through" attribute, this allows Django to create the intermediate table on its own, and then your get_connections() method works as expected! It seems like using a custom through table is causing this somehow. I haven't found a fix but will keep looking.
On Thursday, June 25, 2020 at 8:52:47 AM UTC-4 jes...@gmail.com wrote: > Mike, Thanks for your suggestions. > > Just a stab in the dark - have you tried giving from_contact a >> related_name? >> > > Yes, I have tried a few different combinations of providing a single > related_name and various naming conventions when providing related_name on > both ForeignKey fields without success. > > >> Another stab ... maybe you could just display the >> ContactConnectionAdmin(admin.ModelAdmin) with model=ContactConnection? >> >> > Yes, adding a ModelAdmin for the through table will show all of the > relationships, but it still requires searching both ForeignKey fields to > capture all of the relationships, regardless of which Contact hey were > created on. > > Workarounds are to add two Inlines, one for each through table foreign > key, or perform a compound query to combine the two results. I just figured > that since the capability was added in Django 3.0, that the symmetric > queries were included as well. My guess is that it is possible with the > correct configuration / naming conventions. I'll dive into the code to see > if anything pops up. > > Thanks! > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7ee482c1-60ea-482f-8ffb-5f71ff92a1edn%40googlegroups.com.