clip order

This commit is contained in:
j 2014-02-07 06:47:06 +00:00
parent de8c824c2b
commit 875cbbeaa7
3 changed files with 7 additions and 3 deletions

View file

@ -133,3 +133,7 @@ class EditManager(Manager):
return qs
class ClipManager(Manager):
def get_query_set(self):
return QuerySet(self.model)

View file

@ -374,6 +374,8 @@ class Clip(models.Model):
lightness= models.FloatField(default=0)
volume = models.FloatField(default=0)
objects = managers.ClipManager()
def __unicode__(self):
if self.annotation:
return u'%s' % self.annotation.public_id

View file

@ -175,9 +175,7 @@ def _order_clips(qs, sort):
order = '%s%s' % (operator, key)
order_by.append(order)
if order_by:
#fixme use nulls_last
#qs = qs.order_by(*order_by, nulls_last=True)
qs = qs.order_by(*order_by)
qs = qs.order_by(*order_by, nulls_last=True)
qs = qs.distinct()
return qs