name_iexact
keyword is a parameter we can pass to filter function in django.model. Can someone please help me understand what it does?
Map.objects.filter(name__iexac开发者_开发百科t=self.cleaned_data["name"]).count()
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.
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
精彩评论