我正在构建一个 Django 应用程序,但我对前端的东西非常不熟悉。最终我想构建一个仪表板,但现在我在构建一个与我希望它显示的内容相匹配的视图方面有些困难。
到目前为止,视图类已很好地转移到前端(运行服务器时没有错误),但它不显示值,而是显示黑点。这里附上我的模型、html 代码以及我的 view.py
class Classification(models.Model):
Class = models.CharField(max_length=10, primary_key=True)
revenue_proportion = models.FloatField(default=0)
Quantity_of_item = models.IntegerField(default=0)
percentage_of_items = models.FloatField(default=0)
cumul_percentage_of_items = models.FloatField(default=0)
inventory_dollars = models.FloatField(default=0)
inventory_dollars_percentage = models.FloatField(default=0)
cumul_inventory_dollars_percentage = models.FloatField(default=0)
average_margin = models.FloatField(default=0)
average_sales_week = models.FloatField(default=0)
weekly_percentage_sales = models.FloatField(default=0)
def __str__(self):
return self.Class
class stock_anormal(models.Model):
reference_anormales = models.CharField(max_length=10, primary_key=True)
stock_alerte_calcule = models.FloatField(default=0)
stock_alerte_recommande = models.FloatField(default=0)
en_alerte = models.FloatField(default=0)
def __str__(self):
return self.reference_anormales
class stock_negatif(models.Model):
reference_negatives = models.CharField(max_length=10,primary_key=True)
stock_alerte_calcule = models.FloatField(default=0)
stock_alerte_recommande = models.FloatField(default=0)
risque_de_rupture = models.FloatField(default=0)
def __str__(self):
return self.reference_negatives
米琪卡哇伊
相关分类