From cfd708f1586cdc66eacc4bd89a68f18273db65c1 Mon Sep 17 00:00:00 2001 From: Nathan Chapman Date: Fri, 22 Jul 2022 13:16:02 -0600 Subject: [PATCH] Add better post ordering --- src/core/migrations/0008_alter_post_options.py | 17 +++++++++++++++++ src/core/models.py | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 src/core/migrations/0008_alter_post_options.py diff --git a/src/core/migrations/0008_alter_post_options.py b/src/core/migrations/0008_alter_post_options.py new file mode 100644 index 0000000..d36aa13 --- /dev/null +++ b/src/core/migrations/0008_alter_post_options.py @@ -0,0 +1,17 @@ +# Generated by Django 4.0.6 on 2022-07-22 19:15 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0007_alter_post_recipients'), + ] + + operations = [ + migrations.AlterModelOptions( + name='post', + options={'ordering': ['-updated_at', '-created_at']}, + ), + ] diff --git a/src/core/models.py b/src/core/models.py index b755395..5dfff2d 100644 --- a/src/core/models.py +++ b/src/core/models.py @@ -149,4 +149,4 @@ class Post(models.Model): return self.title class Meta: - ordering = ['-updated_at'] + ordering = ['-updated_at', '-created_at']