devfzn
ca2156ef37
- Modelo contacto en core/models.py - Creación utils/model_abstracts para heredar y usar id con valor uuid - Serializador en core/serializers hereda de rest_frameworks.serializers - Vista contacto en core/views.py - Registro de app en admin - Migraciones
18 lines
447 B
Python
18 lines
447 B
Python
from django.db import models
|
|
from utils.model_abstracts import Model
|
|
from django_extensions.db.models import (
|
|
TimeStampedModel,
|
|
ActivatorModel,
|
|
TitleDescriptionModel
|
|
)
|
|
|
|
class Contact(TimeStampedModel, ActivatorModel, TitleDescriptionModel, Model):
|
|
|
|
class Meta:
|
|
verbose_name_plural = "Contacts"
|
|
|
|
email = models.EmailField(verbose_name="Email")
|
|
|
|
def __str__(self):
|
|
return f'{self.title}'
|