Many-to-Many: Django Template and Template

1

I have the following situation: - Budget - Product - Budget Items

I searched for the Many-to-Many relationship in Django (1.10), so create a Template a Multi-Select. But if I need to, for example, inform the quantity of the product in the Budget Items at the time I am registering a new Budget , I could not associate this type of relation , even more with Jinja .

The idea is to have a budget register screen, where I can add products (can be showmodal in the html), and can inform the quantity, discount, etc., and then be able to save everything.     

asked by anonymous 21.11.2016 / 15:23

1 answer

3

I do not know if I understood your problem correctly, but using "InlineFormSet" does not solve?

link

In addition, it would not make any sense: Budget - Budget Item (Product, Quantity) - Product.

Good luck;)

[EDIT]

One suggestion is to double the value of the product in the Budget Item, if the price of the product changes in the future the budget will change too, which is not usually the case.

    
29.11.2016 / 12:04