I have a problem in calculating Sum.
my models.py is as follows :-
class Book(models.Model):
book_text = models.CharField(max_length=200)
price = models.IntegerField(default=0)
tax = models.DecimalField(max_digits=10, decimal_places=2)
class Author(models.Model):
book = models.ForeignKey(Book)
author_text = models.CharField(max_length=200)
class Total(models.Model):
total = models.IntegerField(default=0)
In this I wish to calculate total of price and tax,tax is applied on every book.
e.g. Book 1 : Price = 450 , Tax =.05
Book 2 : Price= 500 , Tax =.04
Which function should be aplied and in which part of Application?
Muskan
Blog:
http://muskana912.wordpress.com/
I am ready to bear short term pain for long term gain ! :)