31 lines
1.1 KiB
Python
31 lines
1.1 KiB
Python
from django.db import models
|
|
|
|
class Cliente(models.Model):
|
|
STATO_CHOICES = [
|
|
('Cliente', 'Cliente'),
|
|
('Prospect', 'Prospect'),
|
|
('Ex-Cliente', 'Ex-Cliente'),
|
|
]
|
|
CATEGORIA_CHOICES = [
|
|
('Privato', 'Privato'),
|
|
('Azienda', 'Azienda'),
|
|
]
|
|
|
|
nome = models.CharField("Nome", max_length=100)
|
|
cognome = models.CharField("Cognome", max_length=100)
|
|
codice_fiscale = models.CharField("Codice Fiscale", max_length=16, unique=True)
|
|
email = models.EmailField("Email")
|
|
telefono = models.CharField("Telefono", max_length=20)
|
|
data_di_nascita = models.DateField("Data di Nascita")
|
|
lavoro = models.CharField("Lavoro", max_length=100)
|
|
stato = models.CharField("Stato", max_length=20, choices=STATO_CHOICES)
|
|
categoria = models.CharField("Categoria", max_length=20, choices=CATEGORIA_CHOICES)
|
|
|
|
@property
|
|
def importo_portafoglio_attuale(self):
|
|
# This is a calculated field.
|
|
# The logic to calculate this value will be implemented later.
|
|
return 0.00
|
|
|
|
def __str__(self):
|
|
return f"{self.nome} {self.cognome}" |