I have these models:
class Client(models.Model):
is_provider = models.BooleanField()
class Billing(models.Model):
client = models.ForeignKey(Client)
I want to limit the choices of ForeignKey to show only the clients with is_provider=True
. Is there something like:
limit_choices_to = {'is_provider': True}
Or anything I can use to filter the ForeignKey?