我有模型:
class CompanyInfo(models.Model):
name = models.CharField('Имя компании',max_length=250)
class Staff(models.Model):
company_name = models.ForeignKey(CompanyInfo)
date = models.DateField( )
name = models.CharField( max_length=30, )
class Relation(models.Model):
company_name = models.ForeignKey(CompanyInfo)
who = models.ForeignKey(Staff, related_name="who")
with_whom = models.ForeignKey(Staff, related_name="with_whom")
info = models.CharField( max_length=30, )
如何在管理页面上创建动态生成字段WHO
和WITH_WHOM
表单元素?我选择了COMPANY_NAME
, 和字段WHO
,并且WITH_WHOM
只显示该公司的人员。