normalize find values and make lower case, also normalize and lowercase quieries
This commit is contained in:
parent
1bc21588a6
commit
ec5158c03a
7 changed files with 32 additions and 10 deletions
|
|
@ -1,5 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# vi:si:et:sw=4:sts=4:ts=4
|
||||
import unicodedata
|
||||
|
||||
from django.db.models import Q, Manager
|
||||
from ox.django.query import QuerySet
|
||||
|
||||
|
|
@ -59,6 +61,9 @@ def parseCondition(condition, user):
|
|||
}.get(op,'__icontains'))
|
||||
|
||||
key = str(key)
|
||||
if isinstance(v, unicode):
|
||||
v = unicodedata.normalize('NFKD', v).lower()
|
||||
|
||||
if exclude:
|
||||
q = ~Q(**{key: v})
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue