JavaScript
- 3 ответа
- 0 вопросов
4
Вклад в тег
chiefs_by = Person.objects.filter(chief_id=person.id)
class Person(...):
...
department = models.ManyToManyField('Department', verbose_name='подразделение', throught='PersonInDepartment')
class Department(..):
chief = models.ForeignKeyField(Person,....)
...
class PersonInDepartment(...):
person = ForeignKey
department = ForeignKey
position = ForeignKey