Form Mixins with multilayered M2M models

11 views
Skip to first unread message

Ali khan

unread,
Aug 16, 2016, 3:37:11 AM8/16/16
to django...@googlegroups.com
Hi,

I have three models like below:

Shop:
         |
          Products
                        |
                        Variations

Where Shop has a ForeignKey for products and then products has foreign key for variations. So Shop has no ForeignKey with Variations directly instead connected via Products model.

1. I am new to Django and I need to understand that in ShopListView view how to reference variations.

2. Also I need to create a form using FormSetFactory where I can grab data from all the models in hierarchy. Like my form should have edit options for Shop's own model fields with Products model fields and Variation Fields.

Would appreciate any help.

Regards,
Ali

Reply all
Reply to author
Forward
0 new messages