random-topic-shouts-patch-2
All checks were successful
Deploy on push / deploy (push) Successful in 25s
All checks were successful
Deploy on push / deploy (push) Successful in 25s
This commit is contained in:
parent
7a3ce4a982
commit
6c0b43bd14
|
@ -461,11 +461,11 @@ async def load_shouts_random_top(_, _info, options):
|
|||
|
||||
@query.field('load_shouts_random_topic')
|
||||
async def load_shouts_random_topic(_, info, limit: int = 10):
|
||||
random_topic_subquery = random_topic_query(1)
|
||||
random_topic_subquery = random_topic_query(1).subquery()
|
||||
q = (
|
||||
select(Shout, Topic)
|
||||
.join(Shout.topics)
|
||||
.join(random_topic_subquery, Topic.id == random_topic_subquery.c.id)
|
||||
select(Topic, Shout)
|
||||
.select_from(Topic)
|
||||
.join(Shout, Shout.topics.any(Topic.id == random_topic_subquery.c.id))
|
||||
.options(joinedload(Shout.authors))
|
||||
.filter(
|
||||
and_(
|
||||
|
|
Loading…
Reference in New Issue
Block a user