Problem in doing Calcultion in django Application

44 views
Skip to first unread message

Muskan arora

unread,
Jun 18, 2014, 3:25:38 AM6/18/14
to django-d...@googlegroups.com
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 ! :)

Daniele Procida

unread,
Jun 18, 2014, 3:27:29 AM6/18/14
to Django Developers
On Wed, Jun 18, 2014, Muskan arora <muska...@gmail.com> wrote:

>I have a problem in calculating Sum.
> my models.py is as follows :-

You'll get answers to your questions on the django-users email list, <django-d...@googlegroups.com> - the web interface is <https://groups.google.com/forum/#!forum/django-users>.

The list you've posted to is django-developers, an email list is for the discussion of the development of Django itself.

You might also find helpful the #django IRC channel on irc.freenode.net.

I hope that helps,

Daniele

Reply all
Reply to author
Forward
0 new messages