29 lines
642 B
Python
29 lines
642 B
Python
import uuid
|
|
|
|
from django.utils.translation import gettext_lazy as _
|
|
from django.db import models
|
|
|
|
from django_core.models.base import AbstractBaseModel # type: ignore
|
|
|
|
|
|
class UUIDPrimaryKeyBaseModel(AbstractBaseModel):
|
|
id = models.UUIDField(
|
|
verbose_name=_("ID"),
|
|
primary_key=True,
|
|
default=uuid.uuid4,
|
|
editable=False,
|
|
)
|
|
|
|
created_at = models.DateTimeField(
|
|
verbose_name=_("Created At"),
|
|
auto_now_add=True
|
|
)
|
|
|
|
updated_at = models.DateTimeField(
|
|
verbose_name=_("Updated At"),
|
|
auto_now=True
|
|
)
|
|
|
|
class Meta: # type: ignore # noqa
|
|
abstract = True
|