default contains search

This commit is contained in:
j 2011-01-04 16:07:45 +05:30
parent ecad927124
commit 869977a145

View file

@ -53,6 +53,8 @@ def parseCondition(condition):
v = models.Item.objects.filter(facets__key=k, facets__value__istartswith=v) v = models.Item.objects.filter(facets__key=k, facets__value__istartswith=v)
elif op == '$': elif op == '$':
v = models.Item.objects.filter(facets__key=k, facets__value__iendswith=v) v = models.Item.objects.filter(facets__key=k, facets__value__iendswith=v)
else:
v = models.Item.objects.filter(facets__key=k, facets__value__icontains=v)
k = 'id__in' k = 'id__in'
elif op == '=': elif op == '=':
value_key = 'find__value__iexact' value_key = 'find__value__iexact'