``field=value`` is synonymous with ``field__exact=value`` I believe. I
prefer being explicit rather than relying on Django being clever though.


On Wed, May 8, 2013 at 9:57 AM, Simon de Haan <notifications@github.com>wrote:

> In foundry/models.py:
>
> > @@ -509,12 +509,12 @@ def save(self, *args, **kwargs):
> >          # field before but it is now, then there may not be two members with
> >          # the same mobile number.
> >          for fieldname in self.unique_fields:
> > -            values = Member.objects.exclude(**{fieldname: None}).values_list(fieldname, flat=True)
> > +            values = Member.objects.exclude(**{fieldname: None}).exclude(**{fieldname: ''}).values_list(fieldname, flat=True)
>
> I stand corrected:
>
> >>> from django.contrib.auth.models import User>>> print User.objects.filter(username=None).querySELECT "auth_user"."id", "auth_user"."username", "auth_user"."first_name", "auth_user"."last_name", "auth_user"."email", "auth_user"."password", "auth_user"."is_staff", "auth_user"."is_active", "auth_user"**."is_superuser", "auth_user"."last_login", "auth_user"."date_joined" FROM "auth_user" WHERE "auth_user"."username" IS NULL>>> print User.objects.filter(username__exact=None).querySELECT "auth_user"."id", "auth_user"."username", "auth_user"."first_name", "auth_user"."last_name", "auth_user"."email", "auth_user"."password", "auth_user"."is_staff", "auth_user"."is_active", "auth_user"**."is_superuser", "auth_user"."last_login", "auth_user"."date_joined" FROM "auth_user" WHERE "auth_user"."username" IS NULL>>> print User.objects.filter(username__isnull=True).querySELECT "auth_user"."id", "auth_user"."username", "auth_user"."first_name", "auth_user"."last_name", "auth_user"."email", "auth_user"."password", "auth_user"."is_staff", "auth_user"."is_active", "auth_user"**."is_superuser", "auth_user"."last_login", "auth_user"."date_joined" FROM "auth_user" WHERE "auth_user"."username" IS NULL>>>
>
> Is this perhaps a new addition to a recent Django?
>
> ?
> Reply to this email directly or view it on GitHub<https://github.com/praekelt/jmbo-foundry/pull/51/files#r4129723>
> .
>