Re: Adding two columns together

2006-10-09 Thread RajeshD
Hi MerMer, Generally, custom tags (and filters) fit wonderfully with Django's DRY (don't repeat yourself) principle -- once defined, you can reuse them easily in future applications. That said, there's often more than one way to skin the cat in Django and Python. For example, you could have a ge

Re: Adding two columns together

2006-10-09 Thread MerMer
Many thanks - I did check the docs but didn't see it in the Filter section. If I need something similar, which is not covered by a filter (such as an average of columns) - what's the best way to procede. Should I:- a) Do the calculation in the view b) create a custom tag c) Do something else

Re: Adding two columns together

2006-10-09 Thread RajeshD
See: http://www.djangoproject.com/documentation/templates/#add Use it like this: {{ objects.cash|add:objects.cash1 }} On Oct 9, 9:22 am, "MerMer" <[EMAIL PROTECTED]> wrote: > Another newbie question! > > If I have two tags {{ objects.cash }} and another {{ objects.cash1 }} > can I add these t

Adding two columns together

2006-10-09 Thread MerMer
Another newbie question! If I have two tags {{ objects.cash }} and another {{ objects.cash1 }} can I add these together in the template? If not which is the most appropriate way to manage something like this. MerMer --~--~-~--~~~---~--~~ You received this mess