Jul 13 - Optimize code

This commit is contained in:
2026-07-13 16:52:00 -04:00
parent 936d860342
commit 00a9ba7770
27 changed files with 141 additions and 208 deletions
+4 -3
View File
@@ -14,6 +14,7 @@ Supported types: text, number, select, bool. `hot:true` marks a field whose
value is denormalized onto an indexed Listing column for fast filtering.
"""
from datetime import datetime
from app.utils.time import utcnow
from sqlalchemy import JSON
from app.extensions import db
@@ -33,9 +34,9 @@ class Category(db.Model):
sponsor_id = db.Column(db.BigInteger, nullable=True) # FK wired in Phase 5
is_active = db.Column(db.Boolean, nullable=False, default=True)
created_at = db.Column(db.DateTime, default=datetime.utcnow, nullable=False)
updated_at = db.Column(db.DateTime, default=datetime.utcnow,
onupdate=datetime.utcnow, nullable=False)
created_at = db.Column(db.DateTime, default=utcnow, nullable=False)
updated_at = db.Column(db.DateTime, default=utcnow,
onupdate=utcnow, nullable=False)
children = db.relationship("Category", backref=db.backref("parent",
remote_side=[id]), lazy="selectin")