How to specify 'NOT IN' in 'limit_choices_to'? I just want to fetch all the customer details except if they are in one particular status.
customer = models.ForeignKey(Customer, limit_choices_to={'status__in': ['active']})
Just used the Q object instead of a dictionary.
limit_choices_to = ~models.Q(status__in = ['xxxxxx']))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With