syntax fix
This commit is contained in:
parent
11b1471d83
commit
53c3fdc7b8
|
@ -98,9 +98,12 @@ class TopShouts:
|
||||||
# TODO: debug recent shoputs resolver
|
# TODO: debug recent shoputs resolver
|
||||||
month_ago = datetime.now() - timedelta(days = 30)
|
month_ago = datetime.now() - timedelta(days = 30)
|
||||||
with local_session() as session:
|
with local_session() as session:
|
||||||
stmt = select(Shout, func.sum(ShoutViewByDay.value).label("view")).\
|
stmt = select(\
|
||||||
|
Shout,\
|
||||||
|
func.sum(ShoutViewByDay.value).label("view"),\
|
||||||
|
func.sum(ShoutRating.value).label("rating")\
|
||||||
|
).\
|
||||||
join(ShoutViewByDay).\
|
join(ShoutViewByDay).\
|
||||||
func.sum(ShoutRating.value).label("rating").\
|
|
||||||
join(ShoutRating).\
|
join(ShoutRating).\
|
||||||
where(Shouts.createdAt > month_ago).\
|
where(Shouts.createdAt > month_ago).\
|
||||||
group_by(Shout.id).\
|
group_by(Shout.id).\
|
||||||
|
|
Loading…
Reference in New Issue
Block a user