I am trying to have a implementation in Django models where Table 1 will have 5 columns, say like:
table1 : (column1, column2, column3, column4, column5)
where I want column1
, column2
to act as composite primary key instead of Id
column of Django.
table 2: (column6, column7, column8, column9, column10, column 11)
where column6
, column7
are foreign keys which refer to primary keys of column1
, column2
in table 1 and which also act as composite primary keys in table 2.
How can I achieve this in Django, so that as a admin user i can add data to table 1 and also add data to table 2, where first two columns of table 2 i.e column6
, column7
is autopopulated with column1
, column2
data when i want to add data to table 2.
Is this possible in DJango, if yes pls provide concrete working example?