diff --git a/pandora/annotation/models.py b/pandora/annotation/models.py index 65227adfb..d99cabd4e 100644 --- a/pandora/annotation/models.py +++ b/pandora/annotation/models.py @@ -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: diff --git a/pandora/annotation/views.py b/pandora/annotation/views.py index 00d72ab6b..595088e17 100644 --- a/pandora/annotation/views.py +++ b/pandora/annotation/views.py @@ -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):