consistent naming of database fields

This commit is contained in:
Igor Lobanov
2022-11-29 20:13:03 +01:00
parent c064170d24
commit 8209cc744c
20 changed files with 113 additions and 114 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.shout_id == shout.id
ViewedEntry.shoutId == 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(**{
"viewer_id": viewer.id,
"shout_id": shout.id,
"viewerId": viewer.id,
"shoutId": shout.id,
"amount": amount
})
session.add(viewed)