Files
RasadDam_Backend/apps/core/models.py
2025-04-30 15:03:40 +03:30

26 lines
683 B
Python

from django.db import models
from django.conf import settings
class BaseModel(models.Model):
create_date = models.DateTimeField(auto_now_add=True)
modify_date = models.DateTimeField(auto_now=True)
created_by = models.ForeignKey(
settings.AUTH_USER_MODEL,
related_name="%(class)s_createdby",
on_delete=models.CASCADE,
null=True,
blank=True,
)
modified_by = models.ForeignKey(
settings.AUTH_USER_MODEL,
on_delete=models.CASCADE,
related_name="%(class)s_modifiedby",
null=True,
blank=True,
)
trash = models.BooleanField(default=False)
class Meta:
abstract = True