id suffix removed from database relation fields

This commit is contained in:
Igor Lobanov
2022-11-30 18:21:15 +01:00
parent 084d50ac57
commit 479b2230d6
19 changed files with 110 additions and 110 deletions

View File

@@ -128,7 +128,7 @@ class ViewedStorage:
try:
shout = session.query(Shout).where(Shout.slug == shout_slug).one()
shout_views = session.query(func.sum(ViewedEntry.amount)).where(
ViewedEntry.shoutId == shout.id
ViewedEntry.shout == shout.id
).all()[0][0]
self.by_shouts[shout_slug] = shout_views
self.update_topics(session, shout_slug)
@@ -168,8 +168,8 @@ class ViewedStorage:
viewer = session.query(User).where(User.slug == viewer).one()
viewed = ViewedEntry.create(**{
"viewerId": viewer.id,
"shoutId": shout.id,
"viewer": viewer.id,
"shout": shout.id,
"amount": amount
})
session.add(viewed)