Class variables will be shared across all instances. All of the code in the various page methods are manipulating the same variable in the class. You're going to have to extract the customer and itemlist instantiations into some other place. Maybe in the page's awake method you could check the user's session object to see if they have a customer and itemlist object set already, if not, create them and put them into the session object:
def awake(self, transaction):
Page.awake(self, transaction)
if not self.session().hasValue('customer'):
self.session().setValue('customer', Customer())
if not self.session().hasValue('order'):
self.session().setValue('order', Order())
etc...
Then, in all your logic/manipulation code, first get the object you want to manipulate and then do what you need, i.e.:
def test(self): order = self.session().value('order') order.addSomething(...)
But, you're going to have to put *everything* that is customer-specific into a session variable. It might be worth it to abstract out a larger container class that has an API into all of the sub-components...
--T
On Oct 25, 2004, at 10:46 PM, Lincoln Han wrote:
class Cart(Page, BasicItem, ExtendedItem, Shipping):
ValidationError = 'ValidationError'
connInfo = 'hostaddr=127.0.0.1 port=5432 dbname=moewhouse user=frog password=green'
customer = Customer() #store the customer info into the customer object at check out
order = Order() #we will need to store the order into the order object at check out
itemlist = list()
subtotal = 0.00
shipping = Shipping() #Shipping object is part of the WebObjects class
total = 0.00
payTax = False
------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss