Store dic data after axtraction from database it is showing str type in django models

Viewed 13

actually i am storing multiple data in django models..

class Spare(models.Model):
vendor_name = models.CharField(max_length=100, blank=True, null=True)
date = models.DateField(blank=False, null=False)
# details fields
sl_no = models.TextField(blank=True, null=True, default='{}')
product_name = models.TextField(blank=True, null=True , default='{}')
quantity = models.TextField(blank=True, null=True)
cost = models.TextField(blank=True, null=True)
# total fields from quantity and cost  
amount = models.FloatField(blank=True, null=True, default=0.0)

But if i want to get data inthe form of dictionry but it's showing str type so i can't render into django template

And how can i render data into django template

0 Answers
Related