better time usings
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
This module provides the base class that all ORM models inherit from,
|
||||
along with common functionality and mixins.
|
||||
"""
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timezone
|
||||
from typing import Any
|
||||
|
||||
from sqlalchemy import DateTime, func
|
||||
@@ -67,7 +67,7 @@ class SoftDeleteMixin:
|
||||
|
||||
def soft_delete(self) -> None:
|
||||
"""Mark record as deleted without removing from database."""
|
||||
self.deleted_at = datetime.utcnow()
|
||||
self.deleted_at = datetime.now(timezone.utc)
|
||||
|
||||
def restore(self) -> None:
|
||||
"""Restore a soft deleted record."""
|
||||
|
||||
Reference in New Issue
Block a user