select-fix
Some checks are pending
Deploy to core / deploy (push) Waiting to run

This commit is contained in:
Untone 2024-02-21 18:55:21 +03:00
parent b7cbef01a3
commit 2e3d85b43d

View File

@ -98,19 +98,17 @@ def query_follows(user_id: str):
select(column('name'), column('id'), column('slug'), column('pic'), ).select_from(Author) select(column('name'), column('id'), column('slug'), column('pic'), ).select_from(Author)
.join(AuthorFollower, AuthorFollower.follower == author_id) .join(AuthorFollower, AuthorFollower.follower == author_id)
.filter(AuthorFollower.author == Author.id) .filter(AuthorFollower.author == Author.id)
.all()
) )
topics_query = ( topics_query = (
select(column('title'), column('id'), column('slug'), column('pic'), ).select_from(Author) select(column('title'), column('id'), column('slug'), column('pic'), ).select_from(Author)
.join(TopicFollower, TopicFollower.follower == author_id) .join(TopicFollower, TopicFollower.follower == author_id)
.filter(TopicFollower.topic == Topic.id) .filter(TopicFollower.topic == Topic.id)
.all()
) )
# Convert query results to lists of dictionaries # Convert query results to lists of dictionaries
authors = [author.to_dict() for author in authors_query] authors = [author.to_dict() for author in session.execute(authors_query)]
topics = [topic.to_dict() for topic in topics_query] topics = [topic.to_dict() for topic in session.execute(topics_query)]
# shouts_query = ( # shouts_query = (
# session.query(Shout) # session.query(Shout)
# .join(ShoutReactionsFollower, ShoutReactionsFollower.follower == author_id) # .join(ShoutReactionsFollower, ShoutReactionsFollower.follower == author_id)