надеюсь, у вас все хорошо! Я хочу создавать диаграммы на основе моих моделей, я хочу, чтобы вы посоветовали мне некоторые идеи диаграмм, я не мог понять, что мне добавить в свою функцию просмотра, вы можете мне помочь
PS: Я уже использовал несколько простых моделей, и графики были довольно простыми, но эти модели настолько сложны, я надеюсь, вы можете мне посоветовать
from django.db import models
# Create your models here.
class Country(models.Model):
Country = models.CharField(max_length=100)
def __str__(self):
return '{} '.format(self.Country)
class Reason(models.Model):
Reason_cd = models.IntegerField(blank=True)
Reason_NM = models.CharField(max_length=100, blank=True)
def __str__(self):
return '{}'.format(self.Reason_NM)
class Mesure(models.Model):
Mesure_cd = models.IntegerField(blank=True)
Mesure_NM = models.CharField(max_length=100,blank=True)
def __str__(self):
return '{}'.format(self.Mesure_NM)
class Client(models.Model):
last_name = models.CharField(max_length=250)
first_name = models.CharField(max_length=250)
Adresse = models.CharField(max_length=560)
city = models.CharField(max_length=100)
code_postal = models.IntegerField()
phone number = models.IntegerField(blank=True,null=True)
mail = models.CharField(max_length=100)
def __str__(self):
return '{}, {}'.format(self.last_name,self.first_name)
class Delivery_Agent(models.Model):
last_name = models.CharField(max_length=250)
first_name = models.CharField(max_length=250)
def __str__(self):
return '{}, {} '.format(self.last_name,self.first_name)
class Office(models.Model):
office_cd = models.CharField(max_length=10)
office_NM = models.CharField(max_length=50)
def __str__(self):
return '{}, {} '.format(self.office_cd,self.office_NM)
class Mail_item_Event(models.Model):
mail_item_fid = models.CharField(max_length=36)
Event_cd = models.IntegerField(auto_created=True,unique=True) #Event code
office_Evt_cd = models.ForeignKey(Office, on_delete=models.CASCADE, related_name='office_Evt')
Date_Evt = models.DateTimeField()
Date_Capture = models.DateTimeField()
Next_office = models.ForeignKey(Office, on_delete=models.CASCADE, related_name='Next_office')
def __str__(self):
return '{}'.format(self.Event_cd)
class Delivery_info(models.Model):
mail_item_fid = models.OneToOneField(Mail_item_Event ,on_delete=models.CASCADE)
Event_cd = models.OneToOneField(Mail_item_Event,on_delete=models.CASCADE,related_name="delivery_infor_event_cd")
office_Evt_cd = models.ForeignKey(Office,on_delete=models.CASCADE, related_name='office_Evt2')
Date_Evt = models.DateTimeField()
Agent_delivery_cd = models.ForeignKey(Delivery_Agent,on_delete=models.CASCADE,related_name='agentDelivery')
Signatory_NM = models.OneToOneField(Delivery_Agent, on_delete=models.CASCADE, related_name='signatory')
Raison_Non_Delivery_cd = models.ForeignKey(Reason,on_delete=models.CASCADE, related_name='raisonNonDelivery', blank=True)
def __str__(self):
return '{}, {} '.format(self.Signatory_NM,self.mail_item_fid)
class mail_items(models.Model):
mail_item_fid = models.OneToOneField(Mail_item_Event,on_delete=models.CASCADE)
Event_cd = models.OneToOneField(Mail_item_Event,on_delete=models.CASCADE,related_name="mail_item_event_cd")
office_Evt_cd = models.ForeignKey(Office,on_delete=models.CASCADE, related_name='office_Ev')
Date_Evt = models.DateTimeField()
Country_origine = models.ForeignKey(Country, on_delete=models.CASCADE ,related_name='paysOrigine')
Country_destination = models.ForeignKey(Country,on_delete=models.CASCADE,related_name='paysDestination')
Expediteur = models.ForeignKey(Client,on_delete=models.CASCADE,related_name='expedi')
Destinateur = models.ForeignKey(Client,on_delete=models.CASCADE,related_name='destin')