J
J
JonGalt2017-05-19 17:33:09
Django
JonGalt, 2017-05-19 17:33:09

Dependent values ​​in Django form?

models.py

class Company(models.Model):
   name = models.CharField(max_length=64, verbose_name=u'Название компании')
   ....

class Document(models.Model):
     number = models.CharField(max_length=64, verbose_name=u'Номер документа')
     company = models.ForeignKey(Company)
    ...

class Commission(models.Model):
   name = models.CharField(max_length=64, verbose_name=u'Название комиссии')
   ....

class CompanyCommission(models.Model):
   company = models.ForeignKey(Company)
   commission = models.ForeignKey(Commission)
   document = models.ForeignKey(Document)
   ....

Tell me how the form so that when choosing a company in the CompanyCommission model, documents corresponding only to the selected company are selected

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
JonGalt, 2017-05-22
@JonGalt

This solution
helped www.odmin4eg.ru/2011/svyazannye-spiski-select-v-dj...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question