filter queryset based on list, including None
- by jujule
Hi all
I dont know if its a django bug or a feature but i have a strange ORM behaviour with MySQL.
class Status(models.Model):
name = models.CharField(max_length = 50)
class Article(models.Model)
status = models.ForeignKey(status, blank = True, null=True)
filters = Q(status__in =[0, 1,2] ) | Q(status=None)
items =…