Re: Using exists() on queryset for a User

2011-09-26 Thread Kurtis Mullins
That worked perfectly and makes a lot more sense. Thanks! On Mon, Sep 26, 2011 at 4:05 PM, Shawn Milochik wrote: > if User.objects.filter(email = data['email']).exists() > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this g

Re: Using exists() on queryset for a User

2011-09-26 Thread Shawn Milochik
if User.objects.filter(email = data['email']).exists() -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@go

Using exists() on queryset for a User

2011-09-26 Thread Kurtis
I'm trying to check if a user with a specified email already exists. According to the docs, it's better to use the .exists() method. I tried this: if User.objects.exists(email = data['email']): raise forms.ValidationError(u'Email Already Exists') However, I get this error: exists() got an u