Django - How to specify 'NOT IN' in 'limit_choices_to'?
How to specify 'NOT IN' in 'limit_choices_to'? I just want to fetch all the customer deta开发者_Python百科ils 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']))
精彩评论