tags:

views:

64

answers:

2
Map.objects.filter(name__iexact=self.cleaned_data["name"]).count()

thanks

A: 

Hello, I suspect you are using Django or some kind of ORM.

*name__iexact* means that you are doing a case insensitive match on the field name

check for instance http://docs.djangoproject.com/en/dev/topics/db/queries/ for more documentation on django queries.

I hope this will help you, Jerome Wagner

Jerome WAGNER
+1  A: 

It's a case insensitive match. It will retrive database records with "name" field matching self.cleaned_data["name"], while the case doesn't necessarily have to match.

You can construct those lookups appending __iexact to any field name. See the documentation for more on iexact or for list of other similar field lookups.

Ludwik Trammer