Answer the question
In order to leave comments, you need to log in
How to create such relation in Django 2?
Created a ForeignKey relation, and ran into a problem. I need to make the institution related to the model that is responsible for its type. For example, an enterprise has the type "
public catering establishment". In turn, this model has a ForeignKey relationship with the model that is responsible for the establishment's subcategory. For example, the type of establishment "public catering establishment" has subcategories "restaurant", "fast food", etc. In turn, I need to associate this model with the establishment model, but in such a way that when selecting a subcategory, only those cells in the database are displayed that match the institution type.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question