Skip to content

Commit afc2d80

Browse files
committed
Add ordering by datetime_created for project news
1 parent 2c202c4 commit afc2d80

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Generated by Django 4.2 on 2023-06-29 07:45
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("projects", "0017_remove_project_views_count"),
10+
]
11+
12+
operations = [
13+
migrations.AlterModelOptions(
14+
name="projectnews",
15+
options={
16+
"ordering": ["-datetime_created"],
17+
"verbose_name": "Новость проекта",
18+
"verbose_name_plural": "Новости проекта",
19+
},
20+
),
21+
]

projects/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,4 @@ class ProjectNews(models.Model):
228228
class Meta:
229229
verbose_name = "Новость проекта"
230230
verbose_name_plural = "Новости проекта"
231+
ordering = ["-datetime_created"]

0 commit comments

Comments
 (0)