Semantic HTML and post feed #23
|
@ -93,6 +93,11 @@ def get_unread_count(db: DbContext, membership_id: int) -> int:
|
||||||
return db(
|
return db(
|
||||||
select(func.count(Post.id))
|
select(func.count(Post.id))
|
||||||
.join(Membership, Membership.lexicon_id == Post.lexicon_id)
|
.join(Membership, Membership.lexicon_id == Post.lexicon_id)
|
||||||
.where(or_(Membership.last_post_seen.is_(None), Post.created > Membership.last_post_seen))
|
.where(
|
||||||
|
or_(
|
||||||
|
Membership.last_post_seen.is_(None),
|
||||||
|
Post.created > Membership.last_post_seen,
|
||||||
|
)
|
||||||
|
)
|
||||||
.where(Membership.id == membership_id)
|
.where(Membership.id == membership_id)
|
||||||
).scalar()
|
).scalar()
|
||||||
|
|
Loading…
Reference in New Issue