1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Simplified QuerySet field.null handling

QuerySet had previously some complex logic for dealing with nullable
fields in negated add_filter() calls. It seems the logic is leftover
from a time where the WhereNode wasn't as intelligent in handling
field__in=[] conditions.

Thanks to aaugustin for comments on the patch.
This commit is contained in:
Anssi Kääriäinen
2012-04-29 13:45:46 +03:00
parent 9350d1d59c
commit 5aa51fa999
3 changed files with 52 additions and 9 deletions

View File

@@ -346,3 +346,9 @@ class OneToOneCategory(models.Model):
def __unicode__(self):
return "one2one " + self.new_name
class NullableName(models.Model):
name = models.CharField(max_length=20, null=True)
class Meta:
ordering = ['id']