Is this correct?
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'})
I'm trying to make sure that an Order form will only display customer choices that belong to the same account as the Order.
If I'm overlooking some glaring bad-design fallacy, let me know.
The main thing I'm concerned with is:
limit_choices_to={'account': 'self.account'}