mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 19:41:11 +00:00
Merge pull request #790 from mouse-reeve/status-ordering
Status ordering
This commit is contained in:
commit
a0793a15f5
4 changed files with 24 additions and 1 deletions
|
@ -23,6 +23,7 @@ POSTGRES_DB=fedireads
|
||||||
POSTGRES_HOST=db
|
POSTGRES_HOST=db
|
||||||
|
|
||||||
# Redis activity stream manager
|
# Redis activity stream manager
|
||||||
|
MAX_STREAM_LENGTH=200
|
||||||
REDIS_ACTIVITY_HOST=redis_activity
|
REDIS_ACTIVITY_HOST=redis_activity
|
||||||
REDIS_ACTIVITY_PORT=6379
|
REDIS_ACTIVITY_PORT=6379
|
||||||
|
|
||||||
|
|
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,11 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
|
||||||
serialize_reverse_fields = [("attachments", "attachment", "id")]
|
serialize_reverse_fields = [("attachments", "attachment", "id")]
|
||||||
deserialize_reverse_fields = [("attachments", "attachment")]
|
deserialize_reverse_fields = [("attachments", "attachment")]
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
""" default sorting """
|
||||||
|
|
||||||
|
ordering = ("-published_date",)
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
""" save and notify """
|
""" save and notify """
|
||||||
super().save(*args, **kwargs)
|
super().save(*args, **kwargs)
|
||||||
|
|
|
@ -96,7 +96,7 @@ WSGI_APPLICATION = "bookwyrm.wsgi.application"
|
||||||
REDIS_ACTIVITY_HOST = env("REDIS_ACTIVITY_HOST", "localhost")
|
REDIS_ACTIVITY_HOST = env("REDIS_ACTIVITY_HOST", "localhost")
|
||||||
REDIS_ACTIVITY_PORT = env("REDIS_ACTIVITY_PORT", 6379)
|
REDIS_ACTIVITY_PORT = env("REDIS_ACTIVITY_PORT", 6379)
|
||||||
|
|
||||||
MAX_STREAM_LENGTH = env("MAX_STREAM_LENGTH", 200)
|
MAX_STREAM_LENGTH = int(env("MAX_STREAM_LENGTH", 200))
|
||||||
STREAMS = ["home", "local", "federated"]
|
STREAMS = ["home", "local", "federated"]
|
||||||
|
|
||||||
# Database
|
# Database
|
||||||
|
|
Loading…
Reference in a new issue