add sharemetadata to itemKeys. fix queries for boolean keys

This commit is contained in:
j 2016-01-19 16:44:00 +05:30
commit 54b3982787
4 changed files with 26 additions and 5 deletions

View file

@ -98,9 +98,13 @@ class Parser(object):
q = ~q
return q
elif key_type == 'boolean':
q = getattr(self._model, 'find_%s' % k) == v
if exclude:
q = ~q
v = str(v).lower()
v = v == 'true'
vk = getattr(self._sort, k)
q = operators.eq(vk, v)
ids = self._model.query.join(self._sort).filter(q).options(load_only('id'))
in_op = operators.notin_op if exclude else operators.in_op
q = in_op(self._model.id, ids)
return q
elif key_type in ("string", "text"):
if isinstance(v, str):