[Zapp-cvs-commit] ZApp ZApp_Base.py,1.17,1.18 ZApp_MiscData.py,1.10,1.11
Brought to you by:
sspickle
|
From: <ssp...@us...> - 2003-06-20 11:23:22
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv1055
Modified Files:
ZApp_Base.py ZApp_MiscData.py
Log Message:
fixed cache problem by moving _v_MyMDMCache to transaction flush list..
Index: ZApp_Base.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_Base.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** ZApp_Base.py 18 Jun 2003 19:11:19 -0000 1.17
--- ZApp_Base.py 20 Jun 2003 11:23:18 -0000 1.18
***************
*** 307,315 ****
"""
! listishePropNames = ['_indexed_attrs', '_custom_skin_scripts']
!
! for lName in listishePropNames:
flatDict = listisheRecurse(klass, lName)
setattr(klass,lName,flatDict['listishe_masterList'])
def extendProperties_list( klass, props, value_default='', type_default='string', size_default=30 ):
--- 307,317 ----
"""
! for lName in ['_indexed_attrs', '_custom_skin_scripts']:
flatDict = listisheRecurse(klass, lName)
setattr(klass,lName,flatDict['listishe_masterList'])
+
+ for lName in ['__per_transaction_cache_attrs__']:
+ flatDict = listisheRecurse(klass, lName)
+ setattr(klass,lName,tuple(flatDict['listishe_masterList']))
def extendProperties_list( klass, props, value_default='', type_default='string', size_default=30 ):
Index: ZApp_MiscData.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_MiscData.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** ZApp_MiscData.py 20 Jun 2003 04:15:08 -0000 1.10
--- ZApp_MiscData.py 20 Jun 2003 11:23:18 -0000 1.11
***************
*** 36,40 ****
meta_type = "ZApp Misc Data"
! __per_transaction_cache_attrs__ = ZApp_Base.ZApp_Base.__per_transaction_cache_attrs__ + ('_v_xmlDict',)
def _v_xmlDict(self):
--- 36,40 ----
meta_type = "ZApp Misc Data"
! __per_transaction_cache_attrs__ = ('_v_xmlDict',)
def _v_xmlDict(self):
***************
*** 149,153 ****
miscDataManagerKey = None
! _v_MyMDMCache = {}
_custom_skin_scripts = ("WITH self.getMiscData() COMPUTE miscData=RESULT",
--- 149,154 ----
miscDataManagerKey = None
!
! __per_transaction_cache_attrs__ = ('_v_MyMDMCache',)
_custom_skin_scripts = ("WITH self.getMiscData() COMPUTE miscData=RESULT",
***************
*** 156,159 ****
--- 157,170 ----
)
+ def _v_MyMDMCache(self):
+ """get dictionary to lookup MiscData objects I'm using.... """
+
+ self._v_Keeper # make sure we flush at transaction boundaries..
+
+ v = self._v_MyMDMCache = {}
+ return v
+
+ _v_MyMDMCache = ComputedAttribute( _v_MyMDMCache )
+
def applicationURL(self):
"""
***************
*** 231,247 ****
result += thePropManagers
return result
!
! def getMiscDataObj(self, Manager=None, dataType=''):
! """
! get all of my misc data objects that have my manager, objectID, and (optionally) specified data type
! """
!
! if Manager is None:
! Manager = self.miscDataManager
!
! mds = self.getMiscDataSpecialist()
! mdobs = mds and mds.ZApp_getItems( objectID=self.id, Manager=Manager, dataType=dataType)
! return mdobs and mdobs[0]
!
def applyTypeConverter(self, typeCode, value, args=None):
"""
--- 242,246 ----
result += thePropManagers
return result
!
def applyTypeConverter(self, typeCode, value, args=None):
"""
***************
*** 287,291 ****
xmlDict = {}
! mdobj = self.getMiscDataObj(dataType=dataType)
if mdobj:
xmlDict = mdobj.getXMLDict()
--- 286,290 ----
xmlDict = {}
! mdobj = self.getMiscData(dataType=dataType)
if mdobj:
xmlDict = mdobj.getXMLDict()
***************
*** 334,338 ****
return {}
! mdobj = self.getMiscDataObj(dataType=dataType)
if not mdobj:
return {}
--- 333,337 ----
return {}
! mdobj = self.getMiscData(dataType=dataType)
if not mdobj:
return {}
***************
*** 389,393 ****
if propertyManager:
! mdata = client.getMiscDataObj( dataType = name )
if not mdata:
mdata = client.setupMiscData( dataType = name )
--- 388,392 ----
if propertyManager:
! mdata = client.getMiscData( dataType = name )
if not mdata:
mdata = client.setupMiscData( dataType = name )
***************
*** 437,441 ****
propSheet = getattr(client, 'PropSheetFor_' + self.propsheetname)
default = getattr(propSheet, name, '')
! mdata = client.getMiscDataObj( dataType = self.propsheetname)
if not mdata:
--- 436,440 ----
propSheet = getattr(client, 'PropSheetFor_' + self.propsheetname)
default = getattr(propSheet, name, '')
! mdata = client.getMiscData( dataType = self.propsheetname)
if not mdata:
***************
*** 454,458 ****
if propertyManager:
! mdata = client.getMiscDataObj( dataType = name )
if not mdata:
return 0
--- 453,457 ----
if propertyManager:
! mdata = client.getMiscData( dataType = name )
if not mdata:
return 0
***************
*** 545,549 ****
self._client.buildXML()
return result
-
def initialize(context):
--- 544,547 ----
|