two levels of m2m relationship & update values

42 views
Skip to first unread message

Slomski

unread,
Jan 25, 2016, 6:07:41 PM1/25/16
to Django developers (Contributions to Django itself)
Hi,

I am trying to create a django app as follow:

a Block with unique name can have few Flats. Flat name in each Block is unique but flat names can be the same in different Blocks and Flat name needs to be chosen from the range {Paprika, Water, Banana}.
each Flat can have three rooms and room names are Blue, Red, Yellow.
there can be some people staying for a night in each room and the number of peoples can change daily.

so,

you want to update number of people that stay in each room daily by either selecting specific room or selecting multiple rooms so you can update either one room or multiple rooms in one go.

Question 1:

Am I right using right relationships: m2m with m2m relationship ?

Blocks have m2m relationships with Flat names
Flat names have m2m relationship with Room names

Questions 2:

If relationships are correct than how can you update selected single or multiple rooms via two levels of m2m relationship ?

Tim Graham

unread,
Jan 25, 2016, 6:13:13 PM1/25/16
to Django developers (Contributions to Django itself)
Please write to django-users as this mailing list is for the development of Django itself.
Reply all
Reply to author
Forward
0 new messages