From dd490053de5ba77460789ef645cbbf368f1b6e66 Mon Sep 17 00:00:00 2001 From: Nicolas Dumazet <nicolas.dumazet@nexedi.com> Date: Wed, 29 Sep 2010 09:57:50 +0000 Subject: [PATCH] use TempSaleOrder instead or TempOrder as Order portal type does not exist git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38745 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Type/Tool/SessionTool.py | 6 +++--- product/ERP5Type/tests/testSessionTool.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/product/ERP5Type/Tool/SessionTool.py b/product/ERP5Type/Tool/SessionTool.py index f6fad56682..887fb72c56 100644 --- a/product/ERP5Type/Tool/SessionTool.py +++ b/product/ERP5Type/Tool/SessionTool.py @@ -169,8 +169,8 @@ class SessionTool(BaseTool): session_id = '1234567' session = context.portal_sessions[session_id] - session['shopping_cart'] = newTempOrder(context, '987654321') # will work only for local RAM sessions - (you can also use 'session.edit(shopping_cart= newTempOrder(context, '987654321'))' ) + session['shopping_cart'] = newTempSaleOrder(context, '987654321') # will work only for local RAM sessions + (you can also use 'session.edit(shopping_cart= newTempSaleOrder(context, '987654321'))' ) (later in another script you can acquire shopping_cart): @@ -183,7 +183,7 @@ class SessionTool(BaseTool): - it's not recommended to store in portal_sessions ZODB persistent objects because in order to store them in Local RAM portal_sessions tool will remove aquisition wrapper. At "get" request they'll be returend wrapped. - - developer can store temporary RAM based objects like 'TempOrder' but ONLY + - developer can store temporary RAM based objects like 'TempSaleOrder' but ONLY when using Local RAM type of sessions. In a distributed environment one can use only pickable types ue to the nature of memcached server. """ diff --git a/product/ERP5Type/tests/testSessionTool.py b/product/ERP5Type/tests/testSessionTool.py index 751211b477..21b45e2594 100644 --- a/product/ERP5Type/tests/testSessionTool.py +++ b/product/ERP5Type/tests/testSessionTool.py @@ -111,12 +111,12 @@ class TestSessionTool(ERP5TypeTestCase): def stepTestAcquisitionRamSessionStorage(self, sequence=None, \ sequence_list=None, **kw): - from Products.ERP5Type.Document import newTempOrder + from Products.ERP5Type.Document import newTempSaleOrder portal_sessions = self.getPortal().portal_sessions session = portal_sessions.newContent( self.session_id, \ - attr_1 = newTempOrder(portal_sessions, '1'), \ - attr_2 = newTempOrder(portal_sessions, '2'),) + attr_1 = newTempSaleOrder(portal_sessions, '1'), \ + attr_2 = newTempSaleOrder(portal_sessions, '2'),) ## check temp (RAM based) attributes stored in session for i in range (1, 3): attr_name = 'attr_%s' %i -- 2.30.9