diff --git a/pandora/clip/models.py b/pandora/clip/models.py index 656170fda..756090ac4 100644 --- a/pandora/clip/models.py +++ b/pandora/clip/models.py @@ -50,13 +50,14 @@ class Clip(models.Model): def json(self, keys=None): j = {} - clip_keys = ('id', 'in', 'out', 'created', 'modified', + clip_keys = ('id', 'in', 'out', 'position', 'created', 'modified', 'hue', 'saturation', 'lightness', 'volume') for key in clip_keys: j[key] = getattr(self, { 'id': 'public_id', 'in': 'start', 'out': 'end', + 'position': 'start', }.get(key, key)) if keys: for key in j.keys(): diff --git a/pandora/clip/views.py b/pandora/clip/views.py index cd5aefae9..3147ae192 100644 --- a/pandora/clip/views.py +++ b/pandora/clip/views.py @@ -31,9 +31,13 @@ def order_query(qs, sort): operator = e['operator'] if operator != '-': operator = '' + clip_keys = ('start', 'end', 'hue', 'saturation', 'lightness', 'volume' + 'annotations__value') key = { 'in': 'start', 'out': 'end', + 'position': 'start', + 'text': 'annotations__value', }.get(e['key'], e['key']) if key.startswith('clip:'): key = e['key'][len('clip:'):] @@ -41,7 +45,7 @@ def order_query(qs, sort): 'text': 'annotations__value', 'position': 'start', }.get(key, key) - elif key not in ('start', 'end', 'annotations__value'): + elif key not in clip_keys: #key mgith need to be changed, see order_sort in item/views.py key = "item__sort__%s" % key order = '%s%s' % (operator, key)