Fixed sorting for latest pastes

This commit is contained in:
Sebastian 2015-11-08 18:46:23 +01:00
parent 21aaad38cd
commit 4d80983eea
1 changed files with 17 additions and 19 deletions

View File

@ -66,7 +66,7 @@ class Geometry(models.Model):
@classmethod
def get_latest(cls):
return cls.objects.all().filter(public = True).order_by('date')[:10]
return cls.objects.all().filter(public = True).order_by('-date')[:10]
def get_expiration_date(self):
for expiration in [self.HOUR, self.DAY, self.WEEK, self.MONTH]:
@ -166,5 +166,3 @@ class Geometry(models.Model):
if self.polycount == 0:
self._generate_meta_infos()
return self.height