return item id, exclude empty annotations

This commit is contained in:
j 2014-10-26 17:44:36 +00:00
parent e95c9011e7
commit d6513d4570
2 changed files with 3 additions and 1 deletions

View file

@ -237,6 +237,8 @@ class Annotation(models.Model):
if layer or (keys and 'layer' in keys):
j['layer'] = self.layer
if keys and 'item' in keys:
j['item'] = self.item.public_id
if keys:
_j = {}
for key in keys:

View file

@ -58,7 +58,7 @@ def order_query(qs, sort):
order = '%s%s' % (operator, key)
order_by.append(order)
if order_by:
qs = qs.order_by(*order_by, nulls_last=True)
qs = qs.order_by(*order_by, nulls_last=True).exclude(value='')
return qs
def findAnnotations(request, data):