Correcion del CRUD
This commit is contained in:
@@ -5,8 +5,8 @@ from sqlalchemy.orm import Mapped, mapped_column
|
||||
from sqlalchemy.sql import func
|
||||
|
||||
|
||||
class TimestampMixin:
|
||||
"""Mixin for common timestamp fields"""
|
||||
class BaseTimestampMixin:
|
||||
"""Mixin for basic timestamp fields (no soft delete)"""
|
||||
|
||||
created_at: Mapped[datetime] = mapped_column(
|
||||
DateTime, nullable=False, server_default=func.now()
|
||||
@@ -14,6 +14,11 @@ class TimestampMixin:
|
||||
updated_at: Mapped[datetime] = mapped_column(
|
||||
DateTime, nullable=False, server_default=func.now(), onupdate=func.now()
|
||||
)
|
||||
|
||||
|
||||
class TimestampMixin(BaseTimestampMixin):
|
||||
"""Mixin for common timestamp fields including soft delete"""
|
||||
|
||||
deleted_at: Mapped[datetime | None] = mapped_column(DateTime, nullable=True)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user