Hello,
My DEF is not displaying on the Admin Form.
models.py =
class OurProducts(models.Model):
code = models.CharField(max_length=60)
price = models.DecimalField (max_digits=8, decimal_places=2)
def combined_price(self):
from decimal import Decimal
return round(self.price * Decim
Thanks! Solved:
In models.py:
class OurProducts(models.Model):
code = models.CharField(max_length=60)
name = models.CharField(max_length=80)
price = models.DecimalField (max_digits=8, decimal_places=2)
def combined_price(self):
from decimal import Decimal
return round(self.price
models.py
class OurProducts(models.Model):
code = models.CharField(max_length=60)
rrp = models.DecimalField (max_digits=8, decimal_places=2)
def __unicode__(self):
return self.name
def discount_amount(self):
discount=0.65
amount=self.rrp*discount
return amount
My variab
3 matches
Mail list logo