first push
This commit is contained in:
33
Core/models.py
Normal file
33
Core/models.py
Normal file
@@ -0,0 +1,33 @@
|
||||
from django.db import models
|
||||
from django.contrib.auth.models import User, Group
|
||||
from django.conf import settings
|
||||
from datetime import datetime, timezone, time
|
||||
from django.utils import timezone
|
||||
|
||||
import uuid
|
||||
|
||||
|
||||
# Create your views here.
|
||||
class BaseModel(models.Model):
|
||||
key = models.UUIDField(default=uuid.uuid4, editable=False, null=True, unique=True)
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user