mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
Add pool information to API.md
This commit is contained in:
@ -3,7 +3,7 @@ from typing import Any, Optional, Tuple, List, Dict, Callable
|
||||
from datetime import datetime
|
||||
import sqlalchemy as sa
|
||||
from szurubooru import config, db, model, errors, rest
|
||||
from szurubooru.func import util, pool_categories, serialization, posts
|
||||
from szurubooru.func import util, pool_categories, posts, serialization
|
||||
|
||||
|
||||
class PoolNotFoundError(errors.NotFoundError):
|
||||
@ -130,11 +130,9 @@ class PoolSerializer(serialization.BaseSerializer):
|
||||
return self.pool.post_count
|
||||
|
||||
def serialize_posts(self) -> Any:
|
||||
return [
|
||||
{
|
||||
'id': post.post_id
|
||||
}
|
||||
for post in self.pool.posts]
|
||||
return [post for post in
|
||||
[posts.serialize_micro_post(rel, None)
|
||||
for rel in self.pool.posts]]
|
||||
|
||||
|
||||
def serialize_pool(
|
||||
|
@ -209,7 +209,12 @@ def test_serialize_post(
|
||||
'description': 'desc',
|
||||
'category': 'test-cat1',
|
||||
'postCount': 1,
|
||||
'posts': [{'id': 1}],
|
||||
'posts': [
|
||||
{
|
||||
'id': 1,
|
||||
'thumbnailUrl': 'http://example.com/generated-thumbnails/1_244c8840887984c4.jpg',
|
||||
}
|
||||
],
|
||||
'version': 1,
|
||||
'creationTime': datetime(1996, 1, 1),
|
||||
'lastEditTime': datetime(1998, 1, 1),
|
||||
@ -220,7 +225,12 @@ def test_serialize_post(
|
||||
'description': 'desc2',
|
||||
'category': 'test-cat2',
|
||||
'postCount': 1,
|
||||
'posts': [{'id': 1}],
|
||||
'posts': [
|
||||
{
|
||||
'id': 1,
|
||||
'thumbnailUrl': 'http://example.com/generated-thumbnails/1_244c8840887984c4.jpg',
|
||||
}
|
||||
],
|
||||
'version': 1,
|
||||
'creationTime': datetime(1996, 1, 1),
|
||||
'lastEditTime': datetime(1998, 1, 1),
|
||||
|
Reference in New Issue
Block a user