default sort order for documents
authorJan Szejko <janek37@gmail.com>
Wed, 28 Jun 2017 14:13:07 +0000 (16:13 +0200)
committerJan Szejko <janek37@gmail.com>
Wed, 28 Jun 2017 14:13:07 +0000 (16:13 +0200)
apps/catalogue/migrations/0017_auto_20170628_1612.py [new file with mode: 0644]
apps/catalogue/models/document.py

diff --git a/apps/catalogue/migrations/0017_auto_20170628_1612.py b/apps/catalogue/migrations/0017_auto_20170628_1612.py
new file mode 100644 (file)
index 0000000..1e2dc73
--- /dev/null
@@ -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'},
+        ),
+    ]
index a1a0a3c..9863e65 100755 (executable)
@@ -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})