mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-23 01:51:08 +00:00
Adds ordering to status model
This commit is contained in:
parent
a67b0ae8a7
commit
1707bba8a8
2 changed files with 21 additions and 0 deletions
17
bookwyrm/migrations/0058_auto_20210324_1536.py
Normal file
17
bookwyrm/migrations/0058_auto_20210324_1536.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
# Generated by Django 3.1.6 on 2021-03-24 15:36
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('bookwyrm', '0057_user_discoverable'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='status',
|
||||
options={'ordering': ('-published_date',)},
|
||||
),
|
||||
]
|
|
@ -58,6 +58,10 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
|
|||
serialize_reverse_fields = [("attachments", "attachment", "id")]
|
||||
deserialize_reverse_fields = [("attachments", "attachment")]
|
||||
|
||||
class Meta:
|
||||
""" default sorting """
|
||||
ordering = ("-published_date",)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
""" save and notify """
|
||||
super().save(*args, **kwargs)
|
||||
|
|
Loading…
Reference in a new issue