이것이 맞습니까?Django : limit_choices_to (정확합니까?)
class Customer(models.Model):
account = models.ForeignKey(Account)
class Order(models.Model):
account = models.ForeignKey(Account)
customer = models.ForeignKey(Customer, limit_choices_to={'account': 'self.account'})
주문 양식에는 주문과 동일한 계정에 속하는 고객 선택 사항 만 표시됩니다.
멋진 디자인 오류를 간과하는 경우 알려주세요.
내가 가진 걱정 중요한 것은입니다 : 고객에게 외래 키가 Account
를 가리 수 없기 때문에
limit_choices_to={'account': 'self.account'}
질문을 이해하지 못했습니다. 좀 더 명확해질 수 있습니까? – Mayuresh