From 9a60e569d6c935afd57d77f45749c051ab636407 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 7 Jan 2014 11:42:20 +0000 Subject: [PATCH] fixes #1999 --- pandora/document/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora/document/models.py b/pandora/document/models.py index 6df98acaf..bb9a0b810 100644 --- a/pandora/document/models.py +++ b/pandora/document/models.py @@ -66,10 +66,10 @@ class Document(models.Model): self.name_sort = ox.sort_string(self.name or u'')[:255].lower() self.description_sort = ox.sort_string(self.description or u'')[:512].lower() if self.extension == 'pdf': - self.dimension_sort = ox.sort_string('0') + ox.sort_string('%d' % self.pages) + self.dimension_sort = ox.sort_string('1') + ox.sort_string('%d' % self.pages) else: resolution_sort = self.width * self.height - self.dimension_sort = ox.sort_string('1') + ox.sort_string('%d' % resolution_sort) + self.dimension_sort = ox.sort_string('0') + ox.sort_string('%d' % resolution_sort) super(Document, self).save(*args, **kwargs) self.update_matches()