D
D
dezinfo2016-02-10 15:54:35
Django
dezinfo, 2016-02-10 15:54:35

How to implement dependencies on data entry in Django?

Welcome all. Stuck on the next task and can not figure out how to do it. If there is an example I would be grateful.
The essence of the problem:
When adding a new product (model1), depending on the category, a form with attributes should be opened (model2 different for each category). When saving, the selected attributes must be saved as a list in the model field1 based on the selected values ​​in the attribute form.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nerevar_soul, 2016-02-10
@Nerevar_soul

Look towards ForeignKeys.

B
baterson, 2016-02-10
@baterson

If you want to bind events to create and change models, look towards signals
djbook.ru/rel1.7/topics/signals.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question