|
An easy way is to make the cart a list. def AddItem(item) cart = self.session().value('cart',[]) cart.append(item) self.session.setValue('cart',cart) def DelItem(item) cart = self.session().value('cart',[]) try: cart.remove(item) except ValueError: print "Item Removed" self.session.setValue('cart',cart) A better implementation would be an external module where you would pass in a user or session object and get back a cart object. HTH -Aaron Thomas Dennehy wrote:
-- -Aaron http://www.MetroNY.com/ "I don't know what's wrong with my television set. I was getting C-Span and the Home Shopping Network on the same station. I actually bought a congressman." - Bruce Baum |
- [Webware-discuss] Shopping Cart App Thomas Dennehy
- Re: [Webware-discuss] Shopping Cart App Aaron Held
- Re: [Webware-discuss] Shopping Cart App Frank Barknecht
- RE: [Webware-discuss] Shopping Cart App Thomas Dennehy
- Re: [Webware-discuss] Shopping Cart App Ian Bicking
