From: Jan Szejko Date: Wed, 28 Jun 2017 14:13:07 +0000 (+0200) Subject: default sort order for documents X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/58a9ee33481846aca907cae135291852e5e6392a default sort order for documents --- diff --git a/apps/catalogue/migrations/0017_auto_20170628_1612.py b/apps/catalogue/migrations/0017_auto_20170628_1612.py new file mode 100644 index 00000000..1e2dc73e --- /dev/null +++ b/apps/catalogue/migrations/0017_auto_20170628_1612.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.6 on 2017-06-28 16:12 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('catalogue', '0016_auto_20170425_1430'), + ] + + operations = [ + migrations.AlterModelOptions( + name='document', + options={'ordering': ['-revision__created_at'], 'verbose_name': 'document', 'verbose_name_plural': 'documents'}, + ), + ] diff --git a/apps/catalogue/models/document.py b/apps/catalogue/models/document.py index a1a0a3ce..9863e659 100755 --- a/apps/catalogue/models/document.py +++ b/apps/catalogue/models/document.py @@ -74,6 +74,7 @@ class Document(Ref): class Meta: verbose_name = _('document') verbose_name_plural = _('documents') + ordering = ['-revision__created_at'] def short_html(self): return render_to_string('catalogue/book_list/book.html', {'book': self})