✨ Feat: [#10] ulid, 생성일, 수정일 model 추상화
This commit is contained in:
17
common/models/baseModels.py
Normal file
17
common/models/baseModels.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from django.db import models
|
||||
|
||||
from common.utils.codeManger import generate_ulid
|
||||
|
||||
|
||||
class BaseModel(models.Model):
|
||||
id = models.CharField(
|
||||
max_length=26,
|
||||
primary_key=True,
|
||||
default=generate_ulid,
|
||||
editable=False
|
||||
)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
Reference in New Issue
Block a user