1👍
Try doing that using F() objects
:
Something like:
from django.db.models import F
class CustomerSettings(models.Model):
owner = models.ForeignKey(User)
authorized_ips = models.ManyToManyField(AuthorizedIps,
limit_choices_to={'owner': F('customersettings__owner')})
However, you would have to handle cases when you are creating a object. That time no owner
will be set, so limit choices will give you empty set.
Source:stackexchange.com