More fixes to models.

This commit is contained in:
Yaro Kasear 2025-09-05 15:19:58 -05:00
parent 49e6ab38b9
commit e1bb07717b
11 changed files with 40 additions and 14 deletions

View file

@ -6,8 +6,8 @@ Base = declarative_base()
@declarative_mixin
class CRUDMixin:
id = Column(Integer, primary_key=True)
created_at = Column(DateTime, default=func.now())
updated_at = Column(DateTime, default=func.now(), onupdate=func.now())
created_at = Column(DateTime, default=func.now(), nullable=False)
updated_at = Column(DateTime, default=func.now(), nullable=False, onupdate=func.now())
def as_dict(self):
# Combine all columns from all inherited tables