add & operator to find many ids
This commit is contained in:
parent
4ec7e1b6c1
commit
3465d3ee9f
4 changed files with 22 additions and 15 deletions
|
|
@ -70,7 +70,11 @@ def buildCondition(k, op, v, user, exclude=False, owner=None):
|
|||
key_type = get_key_type(k)
|
||||
facet_keys = models.Document.facet_keys
|
||||
if k == 'id':
|
||||
v = ox.fromAZ(v)
|
||||
if op == '&' and isinstance(v, list):
|
||||
v = [ox.fromAZ(id_) for id_ in v]
|
||||
k += get_operator(op)
|
||||
else:
|
||||
v = ox.fromAZ(v)
|
||||
q = Q(**{k: v})
|
||||
if exclude:
|
||||
q = ~Q(id__in=models.Document.objects.filter(q))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue