From 458126f828fdd98657b9d7dea7a7a83073bc19ac Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Thu, 3 Sep 2020 22:00:38 +0200 Subject: [PATCH] Fix comments ordering --- articles/migrations/0020_auto_20200903_2157.py | 16 ++++++++++++++++ articles/models.py | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 articles/migrations/0020_auto_20200903_2157.py diff --git a/articles/migrations/0020_auto_20200903_2157.py b/articles/migrations/0020_auto_20200903_2157.py new file mode 100644 index 0000000..9c3ca5a --- /dev/null +++ b/articles/migrations/0020_auto_20200903_2157.py @@ -0,0 +1,16 @@ +# Generated by Django 3.1 on 2020-09-03 19:57 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("articles", "0019_article_comments_allowed"), + ] + + operations = [ + migrations.AlterModelOptions( + name="comment", options={"ordering": ["created_at"]}, + ), + ] diff --git a/articles/models.py b/articles/models.py index 9657c58..d17704c 100644 --- a/articles/models.py +++ b/articles/models.py @@ -152,7 +152,7 @@ class Comment(AdminUrlMixin, models.Model): user_notified = models.BooleanField(default=False) class Meta: - ordering = ["-created_at"] + ordering = ["created_at"] def __str__(self): return f"{self.username} - {self.content[:50]}"