Re: trying not to do any operations in template, but not sure i can avoid it.

2010-05-20 Thread Bill Freeman
On Thu, May 20, 2010 at 4:24 AM, shofty wrote: > thanks for the swift response. > > On May 19, 10:05 pm, Bill Freeman wrote: >> You could put a method on your basket object which calculates the shipping. >> Then if the basket object is included in the

Re: trying not to do any operations in template, but not sure i can avoid it.

2010-05-20 Thread shofty
thanks for the swift response. On May 19, 10:05 pm, Bill Freeman wrote: > You could put a method on your basket object which calculates the shipping. > Then if the basket object is included in the context, you can trivially call > it. > That seems simple enough for me to do.

Re: trying not to do any operations in template, but not sure i can avoid it.

2010-05-19 Thread Bill Freeman
You could put a method on your basket object which calculates the shipping. Then if the basket object is included in the context, you can trivially call it. Or perhaps better, fix up you all_purchases iterable to append it. Something like: def add_shipping(purchaces_iterable): for i, p

Re: trying not to do any operations in template, but not sure i can avoid it.

2010-05-19 Thread shofty
apologies, i tab spaced before id finished. the if forloop.last is waiting til its written out all fo the html for the items then i was going to add a final item which was shipping to the basket. but cant really do that without doing math in the template. would like to know if anyone knows of a

trying not to do any operations in template, but not sure i can avoid it.

2010-05-19 Thread shofty
not sure if i've totally missed the point of the correct way to do this. because i couldn't get the django-cart project to do what i wanted (and more because there is a note on the page explaining its got bugs and that i should have been able to fix them but not detailing said bugs) i decided to