here is my models.py file
class ProductPage(models.Model):
item=models.CharField(max_length=100)
price=models.IntegerField(null=True, blank=True)
@property
def price_tag(self):
if price>=100000 or price<=9999999:
price=price//100000
return self.str(price)+ 'lac'
my view.py file.
def product(request):
object1=ProductPage.objects.all()
return render(request,'item.html',{'object1':object1})
and index.html file:
{% for i in object1 %}
<tr>
<td>{{i.id}}</td>
<td>{{i.item}}</td>
<td>{{i.price_tag}}</td>
{% endfor%}
In my admin panel price is in form of integer field i.e 10000. I want to convert it into a form as '1 lac' at the display page (see Indian Numbering System). How to do that?