From bf3fd4b39a95c2da57fe0c44a96a35a75c8a3032 Mon Sep 17 00:00:00 2001 From: Untone Date: Thu, 31 Oct 2024 15:10:26 +0300 Subject: [PATCH] captionfix-2 --- resolvers/reader.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/resolvers/reader.py b/resolvers/reader.py index 58aee4ff..e51f621c 100644 --- a/resolvers/reader.py +++ b/resolvers/reader.py @@ -44,13 +44,14 @@ def query_shouts(slug=None, shout_id=None): "id", Author.id, "name", Author.name, "slug", Author.slug, - "pic", Author.pic, - "caption", ShoutAuthor.caption, + "pic", Author.pic ) - ).label("authors"), + ).label("authors") ) + .select_from(ShoutAuthor) .join(Author, ShoutAuthor.author == Author.id) - .group_by(ShoutAuthor.shout) + .where(ShoutAuthor.shout == Shout.id) + .correlate(Shout) .scalar_subquery() ) @@ -164,8 +165,7 @@ def get_shouts_with_stats(q, limit=20, offset=0, author_id=None): "id", Author.id, "name", Author.name, "slug", Author.slug, - "pic", Author.pic, - "caption", ShoutAuthor.caption, + "pic", Author.pic ) ).label("authors") )