diff --git a/fooder/domain/product.py b/fooder/domain/product.py index c3b99eb..1ad7aa3 100644 --- a/fooder/domain/product.py +++ b/fooder/domain/product.py @@ -129,7 +129,8 @@ class Product(Base, CommonMixin): ) ) .values( - usage_count_cached=select(func.count(Entry.id)).where( + usage_count_cached=cls.usage_count_cached + + select(func.count(Entry.id)).where( Entry.product_id == cls.id, Entry.processed == False, )