🛠️

- add show price preference(store in cookies)
This commit is contained in:
2026-06-12 17:36:57 +08:00
parent 3f386e5e38
commit 9e9788ea22
13 changed files with 320 additions and 18 deletions
+10
View File
@@ -14,6 +14,16 @@ _loader = jinja2.FileSystemLoader("templates")
_env = jinja2.Environment(loader=_loader, autoescape=jinja2.select_autoescape(), cache_size=0)
templates = Jinja2Templates(env=_env)
# Custom Jinja2 filter: {{ prop.price|price_fmt(price_pref, prop.area_sqft) }}
from price_pref import format_price as _format_price
def _price_fmt(value, price_pref="total", area_sqft=0):
return _format_price(value, price_pref, area_sqft)
_env.filters["price_fmt"] = _price_fmt
bcrypt_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
oauth2_bearer = OAuth2PasswordBearer(tokenUrl="auth/token", auto_error=False)