mirror of
https://github.com/sstent/AICyclingCoach.git
synced 2026-01-25 16:41:58 +00:00
15 lines
527 B
Python
15 lines
527 B
Python
from datetime import datetime
|
|
from sqlalchemy import Column, Integer, DateTime
|
|
|
|
# Import Base from database.py to ensure models use the same Base instance
|
|
from ..database import Base
|
|
|
|
class BaseModel(Base):
|
|
__abstract__ = True
|
|
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
created_at = Column(DateTime, default=datetime.utcnow)
|
|
updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow)
|
|
|
|
def __repr__(self):
|
|
return f"<{self.__class__.__name__} {self.id}>" |