From a123d4daf7fbb52f5b7a6336a3c8ab4cef3f44e4 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 20 Feb 2012 17:42:13 +0000 Subject: [PATCH] sort by number of annotations --- pandora/event/views.py | 2 +- pandora/item/models.py | 2 ++ pandora/padma.jsonc | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pandora/event/views.py b/pandora/event/views.py index bbbed6c0f..7b353df54 100644 --- a/pandora/event/views.py +++ b/pandora/event/views.py @@ -49,7 +49,7 @@ def addEvent(request): event.set_name_sort(data['nameSort']) event.matches = 0 event.save() - event.update_matches.() + event.update_matches() response = json_response(status=200, text='created') response['data'] = event.json() else: diff --git a/pandora/item/models.py b/pandora/item/models.py index ea6fa2ecd..4b76ec5f4 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -654,6 +654,7 @@ class Item(models.Model): 'id', 'lightness', 'modified', + 'numberofannotations', 'numberofcuts', 'numberoffiles', 'parts', @@ -771,6 +772,7 @@ class Item(models.Model): s.hue = None s.saturation = None s.brighness = None + s.numberofannotations = self.annotations.all().count() s.numberofcuts = len(self.data.get('cuts', [])) if s.duration: s.cutsperminute = s.numberofcuts / (s.duration/60) diff --git a/pandora/padma.jsonc b/pandora/padma.jsonc index d608ccc6f..cb98039dc 100644 --- a/pandora/padma.jsonc +++ b/pandora/padma.jsonc @@ -244,6 +244,12 @@ "type": "layer", "find": true }, + { + "id": "numberofannotations", + "title": "Annotations", + "type": "integer", + "columnWidth": 60 + }, { "id": "duration", "title": "Duration",