12345678910111213141516 |
- import uuid
- from django.db import models
- from django.utils.translation import gettext_lazy as _
- class AbstractModel(models.Model):
- uuid = models.UUIDField(_("UUID"),
- default=uuid.uuid4,
- unique=True, editable=False,
- db_index=True)
- created_at = models.DateTimeField(_("Дата создания"), auto_now_add=True)
- updated_at = models.DateTimeField(_("Дата обновления"), auto_now=True)
- class Meta:
- abstract = True
- ordering = ["-created_at"]
|