forked from 0x2620/pandora
dimensions_sort
This commit is contained in:
parent
a625760838
commit
e1953b671d
1 changed files with 2 additions and 2 deletions
|
@ -66,10 +66,10 @@ class Document(models.Model):
|
||||||
self.name_sort = ox.sort_string(self.name or u'')[:255].lower()
|
self.name_sort = ox.sort_string(self.name or u'')[:255].lower()
|
||||||
self.description_sort = ox.sort_string(self.description or u'')[:512].lower()
|
self.description_sort = ox.sort_string(self.description or u'')[:512].lower()
|
||||||
if self.extension == 'pdf':
|
if self.extension == 'pdf':
|
||||||
self.dimension_sort = ox.sort_string('1') + ox.sort_string('%d' % self.pages)
|
self.dimensions_sort = ox.sort_string('1') + ox.sort_string('%d' % self.pages)
|
||||||
else:
|
else:
|
||||||
resolution_sort = self.width * self.height
|
resolution_sort = self.width * self.height
|
||||||
self.dimension_sort = ox.sort_string('0') + ox.sort_string('%d' % resolution_sort)
|
self.dimensions_sort = ox.sort_string('0') + ox.sort_string('%d' % resolution_sort)
|
||||||
|
|
||||||
super(Document, self).save(*args, **kwargs)
|
super(Document, self).save(*args, **kwargs)
|
||||||
self.update_matches()
|
self.update_matches()
|
||||||
|
|
Loading…
Reference in a new issue