]> gitweb.fperrin.net Git - djsite.git/commitdiff
Add default ordering
authorFrédéric Perrin <frederic.perrin@resel.fr>
Sat, 12 Nov 2016 15:02:33 +0000 (15:02 +0000)
committerFrédéric Perrin <frederic.perrin@resel.fr>
Sat, 12 Nov 2016 15:02:33 +0000 (15:02 +0000)
quotes/migrations/0004_auto_20161112_1454.py [new file with mode: 0644]
quotes/migrations/0005_auto_20161112_1502.py [new file with mode: 0644]
quotes/models.py

diff --git a/quotes/migrations/0004_auto_20161112_1454.py b/quotes/migrations/0004_auto_20161112_1454.py
new file mode 100644 (file)
index 0000000..bee8401
--- /dev/null
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.10.3 on 2016-11-12 14:54
+from __future__ import unicode_literals
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('quotes', '0003_auto_20161101_0132'),
+    ]
+
+    operations = [
+        migrations.AlterModelOptions(
+            name='author',
+            options={'ordering': ['name']},
+        ),
+        migrations.AlterModelOptions(
+            name='quote',
+            options={'ordering': ['pk']},
+        ),
+        migrations.AlterModelOptions(
+            name='work',
+            options={'ordering': ['name']},
+        ),
+    ]
diff --git a/quotes/migrations/0005_auto_20161112_1502.py b/quotes/migrations/0005_auto_20161112_1502.py
new file mode 100644 (file)
index 0000000..38edaa0
--- /dev/null
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.10.3 on 2016-11-12 15:02
+from __future__ import unicode_literals
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('quotes', '0004_auto_20161112_1454'),
+    ]
+
+    operations = [
+        migrations.AlterModelOptions(
+            name='quote',
+            options={'ordering': ['-pk']},
+        ),
+    ]
index 0d7fe333001e4ee77f58216f1ed102cc9c903343..34695dfd9fbdb4af7852b5774d4c6ddb4ac6e7f1 100644 (file)
@@ -52,6 +52,9 @@ class Author(CommonData):
                                   help_text="Date of death (leave blank \
                                   if still alive!)")
 
+    class Meta(CommonData.Meta):
+        ordering = ['name']
+
     def __unicode__(self):
         return self.name
 
@@ -94,6 +97,9 @@ class Work(CommonData):
     def get_absolute_url(self):
         return reverse('quotes:work', args=[str(self.id)])
 
+    class Meta(CommonData.Meta):
+        ordering = ['name']
+
 class Quote(CommonData):
     text = HTMLField()
     tags = models.ManyToManyField(QuoteTag, blank=True)
@@ -104,3 +110,7 @@ class Quote(CommonData):
 
     def get_absolute_url(self):
         return reverse('quotes:onequote', args=[str(self.id)])
+
+    class Meta(CommonData.Meta):
+        ordering = ['-pk']
+