diff --git a/pandora/item/managers.py b/pandora/item/managers.py index 95e3ed81d..de3acda52 100644 --- a/pandora/item/managers.py +++ b/pandora/item/managers.py @@ -186,7 +186,14 @@ class ItemManager(Manager): if only_public: lqs = lqs.filter(public=True) if lqs.count() == 1: - qs = qs.filter(listitem__list__id=lqs[0].id) + if lqs[0].query: + data = lqs[0].query + conditions = parseConditions(data['query']['conditions'], + data['query'].get('operator', '&')) + if conditions: + qs = qs.filter(conditions) + else: + qs = qs.filter(id__in=lqs[0].items.all()) return qs def find(self, data, user): diff --git a/pandora/itemlist/views.py b/pandora/itemlist/views.py index 84f03ee2c..c7ed87c90 100644 --- a/pandora/itemlist/views.py +++ b/pandora/itemlist/views.py @@ -102,7 +102,7 @@ def editList(request): list = get_object_or_404_json(models.List, pk=data['list']) if list.editable(request.user): for key in data: - if key in ('name', 'public'): + if key in ('name', 'public', 'query'): setattr(list, key, data['key']) else: response = json_response(status=403, text='not allowed')