8 lines
280 B
Python
8 lines
280 B
Python
from sqlalchemy import Column, DateTime, func
|
|
from sqlalchemy.ext.declarative import declarative_base
|
|
|
|
Base = declarative_base()
|
|
|
|
class TimestampMixin:
|
|
created_at = Column(DateTime, default=func.now())
|
|
updated_at = Column(DateTime, default=func.now(), onupdate=func.now()) |