creating first models

This commit is contained in:
2025-04-30 15:03:40 +03:30
parent c5cc349d90
commit 5e1428e097
20 changed files with 348 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
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