This commit is contained in:
parent
1f6f722eef
commit
275a1f9a08
|
@ -101,11 +101,8 @@ async def get_shout(_, _info, slug=None, shout_id=None):
|
||||||
if author.id == author_caption.author:
|
if author.id == author_caption.author:
|
||||||
author.caption = author_caption.caption
|
author.caption = author_caption.caption
|
||||||
main_topic = (
|
main_topic = (
|
||||||
session.query(ShoutTopics.topic_slug)
|
session.query(Topic.slug)
|
||||||
.filter(
|
.join(ShoutTopic, and_(ShoutTopic.topic == Topic.id, ShoutTopic.shout == shout.id, ShoutTopic.main == True))
|
||||||
ShoutTopics.shout_id == shout.id,
|
|
||||||
ShoutTopics.main == True
|
|
||||||
)
|
|
||||||
.first()
|
.first()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -170,11 +167,8 @@ async def load_shouts_by(_, _info, options):
|
||||||
with local_session() as session:
|
with local_session() as session:
|
||||||
for [shout, reacted_stat, commented_stat, rating_stat, _last_comment] in session.execute(q).unique():
|
for [shout, reacted_stat, commented_stat, rating_stat, _last_comment] in session.execute(q).unique():
|
||||||
main_topic = (
|
main_topic = (
|
||||||
session.query(ShoutTopics.topic_slug)
|
session.query(Topic.slug)
|
||||||
.filter(
|
.join(ShoutTopic, and_(ShoutTopic.topic == Topic.id, ShoutTopic.shout == shout.id, ShoutTopic.main == True))
|
||||||
ShoutTopics.shout_id == shout.id,
|
|
||||||
ShoutTopics.main == True
|
|
||||||
)
|
|
||||||
.first()
|
.first()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -214,11 +208,8 @@ async def load_shouts_drafts(_, info):
|
||||||
q = q.group_by(Shout.id)
|
q = q.group_by(Shout.id)
|
||||||
for [shout] in session.execute(q).unique():
|
for [shout] in session.execute(q).unique():
|
||||||
main_topic = (
|
main_topic = (
|
||||||
session.query(ShoutTopics.topic_slug)
|
session.query(Topic.slug)
|
||||||
.filter(
|
.join(ShoutTopic, and_(ShoutTopic.topic == Topic.id, ShoutTopic.shout == shout.id, ShoutTopic.main == True))
|
||||||
ShoutTopics.shout_id == shout.id,
|
|
||||||
ShoutTopics.main == True
|
|
||||||
)
|
|
||||||
.first()
|
.first()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -277,11 +268,8 @@ async def load_shouts_feed(_, info, options):
|
||||||
shouts = []
|
shouts = []
|
||||||
for [shout, reacted_stat, commented_stat, rating_stat, _last_comment] in session.execute(q).unique():
|
for [shout, reacted_stat, commented_stat, rating_stat, _last_comment] in session.execute(q).unique():
|
||||||
main_topic = (
|
main_topic = (
|
||||||
session.query(ShoutTopics.topic_slug)
|
session.query(Topic.slug)
|
||||||
.filter(
|
.join(ShoutTopic, and_(ShoutTopic.topic == Topic.id, ShoutTopic.shout == shout.id, ShoutTopic.main == True))
|
||||||
ShoutTopics.shout_id == shout.id,
|
|
||||||
ShoutTopics.main == True
|
|
||||||
)
|
|
||||||
.first()
|
.first()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user