aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstuppie2026-10-08 15:11:52 -0600
committerstuppie2026-10-08 15:11:52 -0600
commit8d6ad7203f6f4595d00edabfe229e5ffcc076916 (patch)
tree6b81b5e711f35a0ec25b5d5dbc382f58b7fe213f
parent24b02c82b7ac8daa2274cf6266dde83e2810346e (diff)
downloadgeneralresearch-8d6ad7203f6f4595d00edabfe229e5ffcc076916.tar.gz
generalresearch-8d6ad7203f6f4595d00edabfe229e5ffcc076916.zip
fix prefetch_products call. comment out payouts and pop_financial from product manager update_cached_fieldsv3.7.4
-rw-r--r--generalresearch/managers/thl/product.py10
-rw-r--r--generalresearch/models/gr/business.py2
-rw-r--r--generalresearch/models/gr/team.py2
-rw-r--r--pyproject.toml2
4 files changed, 9 insertions, 7 deletions
diff --git a/generalresearch/managers/thl/product.py b/generalresearch/managers/thl/product.py
index b81fc1d..aadb30b 100644
--- a/generalresearch/managers/thl/product.py
+++ b/generalresearch/managers/thl/product.py
@@ -40,12 +40,14 @@ logger = logging.getLogger()
class ProductManager(PostgresManager):
+ # Commented out payouts and pop_financial. These are sometimes
+ # really big; we need to store only a summary or not at all.
CACHED_FIELDS: frozenset[str] = frozenset(
{
"balance",
"user_wallet_balance",
- "payouts",
- "pop_financial",
+ # "payouts",
+ # "pop_financial",
"users_active_7d",
"task_completes_7d",
"balance_net_7d",
@@ -55,8 +57,8 @@ class ProductManager(PostgresManager):
{
"balance",
"user_wallet_balance",
- "payouts",
- "pop_financial",
+ # "payouts",
+ # "pop_financial",
}
)
diff --git a/generalresearch/models/gr/business.py b/generalresearch/models/gr/business.py
index 2104650..5ed85f2 100644
--- a/generalresearch/models/gr/business.py
+++ b/generalresearch/models/gr/business.py
@@ -286,7 +286,7 @@ class Business(BaseModel):
:return: All the Products for this Business
"""
- self.products = product_manager.fetch_uuids(business_uuids=[self.uuid])
+ self.products = product_manager.filter_paginated(business_uuids=[self.uuid])
def prefetch_bank_accounts(
self, business_bank_account_manager: BusinessBankAccountManager
diff --git a/generalresearch/models/gr/team.py b/generalresearch/models/gr/team.py
index 8d23bc5..217f184 100644
--- a/generalresearch/models/gr/team.py
+++ b/generalresearch/models/gr/team.py
@@ -136,7 +136,7 @@ class Team(BaseModel):
self.businesses = gr_business_manager.get_by_team(team_id=self.id)
def prefetch_products(self, product_manager: ProductManager) -> None:
- self.products = product_manager.fetch_uuids(team_uuids=[self.uuid])
+ self.products = product_manager.filter_paginated(team_uuids=[self.uuid])
# --- Prebuild Methods ---
diff --git a/pyproject.toml b/pyproject.toml
index 957c120..08ed683 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "generalresearch"
-version = "3.7.3"
+version = "3.7.4"
description = "Python Utilities for General Research"
readme = "README.md"
requires-python = ">=3.14"