aboutsummaryrefslogtreecommitdiff
path: root/server/szurubooru/model
diff options
context:
space:
mode:
authorRuin0x112020-05-04 19:12:54 -0700
committerRuin0x112020-05-04 19:12:54 -0700
commit5ca21f9e7f5447a2c7841c1317dbe8df01b04e97 (patch)
treeb807a323d84653c2a1af707436bd002973cc132f /server/szurubooru/model
parent6b8e3f251f69c9d7d560148100cdb8df941a81c2 (diff)
Add pool tests
Diffstat (limited to 'server/szurubooru/model')
-rw-r--r--server/szurubooru/model/pool.py2
-rw-r--r--server/szurubooru/model/post.py1
2 files changed, 2 insertions, 1 deletions
diff --git a/server/szurubooru/model/pool.py b/server/szurubooru/model/pool.py
index 8f7c605..70595d9 100644
--- a/server/szurubooru/model/pool.py
+++ b/server/szurubooru/model/pool.py
@@ -70,9 +70,9 @@ class Pool(Base):
order_by='PoolName.order')
_posts = sa.orm.relationship(
'PoolPost',
- back_populates='pool',
cascade='all,delete-orphan',
lazy='joined',
+ back_populates='pool',
order_by='PoolPost.order',
collection_class=ordering_list('order'))
posts = association_proxy('_posts', 'post')
diff --git a/server/szurubooru/model/post.py b/server/szurubooru/model/post.py
index 56eaefa..11da866 100644
--- a/server/szurubooru/model/post.py
+++ b/server/szurubooru/model/post.py
@@ -229,6 +229,7 @@ class Post(Base):
comments = sa.orm.relationship('Comment', cascade='all, delete-orphan')
_pools = sa.orm.relationship(
'PoolPost',
+ cascade='all,delete-orphan',
lazy='select',
order_by='PoolPost.order',
back_populates='post')

© 2015 - 2026 Jakob L. Kreuze