Wednesday, June 25, 2014

Re: Using Sum function in Models.py

I recommend you send through the code for model you are talking about
- since it doesn't make sense to have a sum of a single field of a
model.


Do you really want to keep the sum in the DB and not calculate it as needed?

Maybe if you told us what your desired end point is, we could suggest
best practice?

cheers
L.



On 26 June 2014 14:52, Amitt Bhardwj <amitt.bhardwj@gmail.com> wrote:
> I want to define a field in models.py which contains sum of a other field in
> same model class. I tried importing sum function in models but it gave
> errors. Please help me.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscribe@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/756bbafb-ffc8-4cbb-a773-ef242e835f76%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
The idea is that a beautiful image is frameable. Everything you need
to see is there: It's everything you want, and it's very pleasing
because there's no extra information that you don't get to see.
Everything's in a nice package for you. But sublime art is
unframeable: It's an image or idea that implies that there's a bigger
image or idea that you can't see: You're only getting to look at a
fraction of it, and in that way it's both beautiful and scary, because
it's reminding you that there's more that you don't have access to.
It's now sort of left the piece itself and it's become your own
invention, so it's personal as well as being scary as well as being
beautiful, which is what I really like about art like that.
-----------------------------------------------------------------------------------------------------------
Adventure Time http://theholenearthecenteroftheworld.com/

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAGBeqiNVNMmfRy-yH70JMYTRpQM6UQZK3RjvpYHVo7jdwPwCJA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment