diff options
| author | Ruin0x11 | 2020-05-04 19:12:54 -0700 |
|---|---|---|
| committer | Ruin0x11 | 2020-05-04 19:12:54 -0700 |
| commit | 5ca21f9e7f5447a2c7841c1317dbe8df01b04e97 (patch) | |
| tree | b807a323d84653c2a1af707436bd002973cc132f /server/szurubooru/model | |
| parent | 6b8e3f251f69c9d7d560148100cdb8df941a81c2 (diff) | |
Add pool tests
Diffstat (limited to 'server/szurubooru/model')
| -rw-r--r-- | server/szurubooru/model/pool.py | 2 | ||||
| -rw-r--r-- | server/szurubooru/model/post.py | 1 |
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') |