aboutsummaryrefslogtreecommitdiff
path: root/server/szurubooru/func
diff options
context:
space:
mode:
authorRuin0x112020-05-04 02:20:23 -0700
committerRuin0x112020-05-04 02:20:23 -0700
commit8795279a73e976a3aadbb4b9067209a46f138733 (patch)
tree8d0742d03bd5c2847c5fd813fb3105be961c3b88 /server/szurubooru/func
parente6bf102bc03504d9abc584f15da70a5fed7fa950 (diff)
Add pool input box in post details
Diffstat (limited to 'server/szurubooru/func')
-rw-r--r--server/szurubooru/func/posts.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/server/szurubooru/func/posts.py b/server/szurubooru/func/posts.py
index 64b00c9..723a466 100644
--- a/server/szurubooru/func/posts.py
+++ b/server/szurubooru/func/posts.py
@@ -5,7 +5,7 @@ from datetime import datetime
import sqlalchemy as sa
from szurubooru import config, db, model, errors, rest
from szurubooru.func import (
- users, scores, comments, tags, util,
+ users, scores, comments, tags, pools, util,
mime, images, files, image_hash, serialization, snapshots)
@@ -176,6 +176,7 @@ class PostSerializer(serialization.BaseSerializer):
'hasCustomThumbnail': self.serialize_has_custom_thumbnail,
'notes': self.serialize_notes,
'comments': self.serialize_comments,
+ 'pools': self.serialize_pools,
}
def serialize_id(self) -> Any:
@@ -299,6 +300,14 @@ class PostSerializer(serialization.BaseSerializer):
self.post.comments,
key=lambda comment: comment.creation_time)]
+ def serialize_pools(self) -> Any:
+ return [
+ pools.serialize_pool(pool)
+ for pool in sorted(
+ self.post.pools,
+ key=lambda pool: pool.creation_time)]
+
+
def serialize_post(
post: Optional[model.Post],

© 2015 - 2026 Jakob L. Kreuze