Skip to content

Commit

Permalink
Add default ordering to the Notification model so that they come in c…
Browse files Browse the repository at this point in the history
…hronological order based off of creation_at datetime
  • Loading branch information
PaulGilmartin committed Oct 20, 2023
1 parent 9078236 commit ecd95eb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pgpubsub/migrations/0005_alter_notification_options.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 3.2.22 on 2023-10-20 00:17

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('pgpubsub', '0004_notification_pgpubsub_notification_set_db_version'),
]

operations = [
migrations.AlterModelOptions(
name='notification',
options={'ordering': ['created_at']},
),
]
1 change: 1 addition & 0 deletions pgpubsub/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Meta:
""",
)
]
ordering = ['created_at']

def __repr__(self):
return (
Expand Down

0 comments on commit ecd95eb

Please sign in to comment.