forked from 0x2620/pandora
empty condition
This commit is contained in:
parent
6f0d76b5c5
commit
f436f88bf6
1 changed files with 3 additions and 5 deletions
|
@ -180,7 +180,7 @@ def parseConditions(conditions, operator):
|
||||||
else:
|
else:
|
||||||
q = q & c
|
q = q & c
|
||||||
return q
|
return q
|
||||||
return None
|
return Q()
|
||||||
|
|
||||||
|
|
||||||
class ItemManager(Manager):
|
class ItemManager(Manager):
|
||||||
|
@ -206,8 +206,7 @@ class ItemManager(Manager):
|
||||||
data = lqs[0].query
|
data = lqs[0].query
|
||||||
conditions = parseConditions(data['query']['conditions'],
|
conditions = parseConditions(data['query']['conditions'],
|
||||||
data['query'].get('operator', '&'))
|
data['query'].get('operator', '&'))
|
||||||
if conditions:
|
qs = qs.filter(conditions)
|
||||||
qs = qs.filter(conditions)
|
|
||||||
else:
|
else:
|
||||||
qs = qs.filter(id__in=lqs[0].items.all())
|
qs = qs.filter(id__in=lqs[0].items.all())
|
||||||
return qs
|
return qs
|
||||||
|
@ -240,8 +239,7 @@ class ItemManager(Manager):
|
||||||
qs = qs.filter(available=True)
|
qs = qs.filter(available=True)
|
||||||
conditions = parseConditions(data['query'].get('conditions', []),
|
conditions = parseConditions(data['query'].get('conditions', []),
|
||||||
data['query'].get('operator', '&'))
|
data['query'].get('operator', '&'))
|
||||||
if conditions:
|
qs = qs.filter(conditions)
|
||||||
qs = qs.filter(conditions)
|
|
||||||
|
|
||||||
#FIXME: lists are part of query now
|
#FIXME: lists are part of query now
|
||||||
# filter list, works for own or public lists
|
# filter list, works for own or public lists
|
||||||
|
|
Loading…
Reference in a new issue