You have to define table B as a model and to set it a class Admin. It is impossible to edit the intermediate table, created from standard ManyToManyField, as a separate model in Django.To sum up, you must have all tables A, B, and C, defined as different models.
Good luck!Aidas Bendoraitis [aka Arc
Many thanks Aidas, I'm having a play around to see. As a follow-on
do you know how I can make table B appear in the Admin - if I use a
many-to-many reference directly from A to C instead.
If I do this, I understand that Django will automatically create the
join table, but how do I get it to d
Yes, you can.There are no problems except the fact, that B has to be created and edited as a separate model in the contributed administration and you won't be able to set C's for A, from within A with those select widgets. Although you can still set the administration so that you could edit B as in
Since a many-to-many relationship is effectively a join table of two
1-many relationships can you implement a many-to-many relationship like
this in django like this? Any problems associated with this approach?
class A
class B
foreignkey(A)
foreignKey(C)
class C
MerMer
--~--~---
4 matches
Mail list logo