You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Organization(Entity):
name = models.CharField(max_length=100)
class Program(Entity):
name = models.CharField(max_length=100)
members = models.ManyToManyField(Organization, through="ProgramMember")
class ProgramMember(Entity):
organization = models.ForeignKey(Organization, on_delete=models.CASCADE)
program = models.ForeignKey(Program, on_delete=models.CASCADE)
I was expecting a diagram with Organization on the left, Program on the right, and ProgramMember in the middle connecting the two, but instead I got this:
Is ManyToManyField with the through keyword supported?
I don't think we have support for through models yet, but it shouldn't be hard.
If you look at the image, you can see there are two arrows in the red circle - And I'd guess that its drawn the connections over one another, because from a raw fields perspective, its drawing:
Program Member -> Organisation
Program Member -> Program
Yes, there is something strange about how the lines are drawn. The blue line is drawn on top of the grey arrowheads. I think that from a raw fields perspective it's drawing
Program Member -> Organisation
Program Member -> Program
Organisation -> Program
Program -> Organisation
I'm trying django spaghetti with these models
I was expecting a diagram with
Organization
on the left,Program
on the right, andProgramMember
in the middle connecting the two, but instead I got this:Is ManyToManyField with the
through
keyword supported?The text was updated successfully, but these errors were encountered: