Fix comments ordering
This commit is contained in:
parent
cb0fa2da94
commit
458126f828
2 changed files with 17 additions and 1 deletions
16
articles/migrations/0020_auto_20200903_2157.py
Normal file
16
articles/migrations/0020_auto_20200903_2157.py
Normal file
|
@ -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"]},
|
||||||
|
),
|
||||||
|
]
|
|
@ -152,7 +152,7 @@ class Comment(AdminUrlMixin, models.Model):
|
||||||
user_notified = models.BooleanField(default=False)
|
user_notified = models.BooleanField(default=False)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ["-created_at"]
|
ordering = ["created_at"]
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"{self.username} - {self.content[:50]}"
|
return f"{self.username} - {self.content[:50]}"
|
||||||
|
|
Reference in a new issue