23 lines
417 B
Python
23 lines
417 B
Python
|
import uuid
|
||
|
|
||
|
from django.db import models
|
||
|
|
||
|
|
||
|
class CreatedUpdatedModel(models.Model):
|
||
|
class Meta:
|
||
|
abstract = True
|
||
|
|
||
|
created = models.DateTimeField(auto_now_add=True)
|
||
|
updated = models.DateTimeField(auto_now=True)
|
||
|
|
||
|
|
||
|
class UUIDModel(models.Model):
|
||
|
class Meta:
|
||
|
abstract = True
|
||
|
|
||
|
uuid = models.UUIDField(
|
||
|
primary_key=True,
|
||
|
default=uuid.uuid4,
|
||
|
editable=False,
|
||
|
)
|