sort by number of annotations

This commit is contained in:
j 2012-02-20 17:42:13 +00:00
parent c017e935ad
commit a123d4daf7
3 changed files with 9 additions and 1 deletions

View file

@ -49,7 +49,7 @@ def addEvent(request):
event.set_name_sort(data['nameSort']) event.set_name_sort(data['nameSort'])
event.matches = 0 event.matches = 0
event.save() event.save()
event.update_matches.() event.update_matches()
response = json_response(status=200, text='created') response = json_response(status=200, text='created')
response['data'] = event.json() response['data'] = event.json()
else: else:

View file

@ -654,6 +654,7 @@ class Item(models.Model):
'id', 'id',
'lightness', 'lightness',
'modified', 'modified',
'numberofannotations',
'numberofcuts', 'numberofcuts',
'numberoffiles', 'numberoffiles',
'parts', 'parts',
@ -771,6 +772,7 @@ class Item(models.Model):
s.hue = None s.hue = None
s.saturation = None s.saturation = None
s.brighness = None s.brighness = None
s.numberofannotations = self.annotations.all().count()
s.numberofcuts = len(self.data.get('cuts', [])) s.numberofcuts = len(self.data.get('cuts', []))
if s.duration: if s.duration:
s.cutsperminute = s.numberofcuts / (s.duration/60) s.cutsperminute = s.numberofcuts / (s.duration/60)

View file

@ -244,6 +244,12 @@
"type": "layer", "type": "layer",
"find": true "find": true
}, },
{
"id": "numberofannotations",
"title": "Annotations",
"type": "integer",
"columnWidth": 60
},
{ {
"id": "duration", "id": "duration",
"title": "Duration", "title": "Duration",