clip order
This commit is contained in:
parent
de8c824c2b
commit
875cbbeaa7
3 changed files with 7 additions and 3 deletions
|
@ -133,3 +133,7 @@ class EditManager(Manager):
|
||||||
return qs
|
return qs
|
||||||
|
|
||||||
|
|
||||||
|
class ClipManager(Manager):
|
||||||
|
|
||||||
|
def get_query_set(self):
|
||||||
|
return QuerySet(self.model)
|
||||||
|
|
|
@ -374,6 +374,8 @@ class Clip(models.Model):
|
||||||
lightness= models.FloatField(default=0)
|
lightness= models.FloatField(default=0)
|
||||||
volume = models.FloatField(default=0)
|
volume = models.FloatField(default=0)
|
||||||
|
|
||||||
|
objects = managers.ClipManager()
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
if self.annotation:
|
if self.annotation:
|
||||||
return u'%s' % self.annotation.public_id
|
return u'%s' % self.annotation.public_id
|
||||||
|
|
|
@ -175,9 +175,7 @@ def _order_clips(qs, sort):
|
||||||
order = '%s%s' % (operator, key)
|
order = '%s%s' % (operator, key)
|
||||||
order_by.append(order)
|
order_by.append(order)
|
||||||
if order_by:
|
if order_by:
|
||||||
#fixme use nulls_last
|
qs = qs.order_by(*order_by, nulls_last=True)
|
||||||
#qs = qs.order_by(*order_by, nulls_last=True)
|
|
||||||
qs = qs.order_by(*order_by)
|
|
||||||
qs = qs.distinct()
|
qs = qs.distinct()
|
||||||
return qs
|
return qs
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue