from django.db import models
from clientes.models import Clientes
class Agendamento(models.Model):
cliente = models.ForeignKey(Clientes, on_delete=models.CASCADE)
data = models.DateField()
hora = models.TimeField()
cor = models.CharField(max_length=10)
local = models.CharField(max_length=200)
procedimento = models.CharField(max_length=150)
obs_agenda = models.TextField()
sessoes = models.IntegerField()
cancelado = models.BooleanField(default=False)
def __str__(self):
return self.cliente.nome
clientes - models.py
-------------------------------------
from django.db import models
class Clientes(models.Model):
nome = models.CharField(max_length=200)
data_nascimento = models.DateField()
altura = models.FloatField(max_length=4)
peso = models.FloatField(max_length=6)
endereco = models.CharField(max_length=300)
foto = models.ImageField(upload_to='fotos/', blank=True)
obs = models.TextField(max_length=400)
def __str__(self):
return self.nome
APP - admin.py
-----------------------------------
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'clientes',
'agendamentos',
]
Alguém pode me ajudar?