23 lines
507 B
Python
23 lines
507 B
Python
from django.db import models
|
|
|
|
import uuid
|
|
|
|
|
|
class BaseModel(models.Model):
|
|
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
|
|
|
# Timestamps
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
updated_at = models.DateTimeField(auto_now=True)
|
|
|
|
class Meta:
|
|
abstract = True
|
|
|
|
|
|
class Event(BaseModel):
|
|
name = models.CharField(max_length=255)
|
|
path = models.SlugField(max_length=100, unique=True)
|
|
|
|
def __str__(self) -> str:
|
|
return self.name
|