Commit ad3faa02 authored by Bartek Górny's avatar Bartek Górny

removed caching of wiki methods - it was very bad

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9939 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b81dc135
......@@ -232,16 +232,22 @@ class DMSFile(XMLObject,File):
getWikiSuccessorValueList - the way to find objects is on
implementation level
'''
def cached_getWikiSuccessorValueList():
lst=[]
for ref in self.getWikiSuccessorReferenceList():
res=self.DMS_findDocument(ref)
if len(res)>0:
lst.append(res[0].getObject())
return lst
cached_getWikiSuccessorValueList = CachingMethod(cached_getWikiSuccessorValueList,
id='DMSFile_getWikiSuccessorValueList')
return cached_getWikiSuccessorValueList()
lst=[]
for ref in self.getWikiSuccessorReferenceList():
res=self.DMS_findDocument(ref)
if len(res)>0:
lst.append(res[0].getObject())
return lst
#def cached_getWikiSuccessorValueList():
#lst=[]
#for ref in self.getWikiSuccessorReferenceList():
#res=self.DMS_findDocument(ref)
#if len(res)>0:
#lst.append(res[0].getObject())
#return lst
#cached_getWikiSuccessorValueList = CachingMethod(cached_getWikiSuccessorValueList,
#id='DMSFile_getWikiSuccessorValueList')
#return cached_getWikiSuccessorValueList()
security.declareProtected(Permissions.View, 'getWikiPredecessorValueList')
def getWikiPredecessorValueList(self):
......@@ -250,21 +256,26 @@ class DMSFile(XMLObject,File):
document, and on how a doc must reference me to be my predecessor (reference only,
or with a language, etc
'''
def cached_getWikiPredecessorValueList():
lst=self.DMS_findPredecessors()
lst=[r.getObject() for r in lst]
di=dict.fromkeys(lst) # make it unique
ref=self.getReference()
return [o for o in di.keys() if o.getReference()!=ref] # every object has its own reference in SearchableText
cached_getWikiPredecessorValueList=CachingMethod(cached_getWikiPredecessorValueList,
id='DMSFile_getWikiPredecessorValueList')
return cached_getWikiPredecessorValueList()
lst=self.DMS_findPredecessors()
lst=[r.getObject() for r in lst]
di=dict.fromkeys(lst) # make it unique
ref=self.getReference()
return [o for o in di.keys() if o.getReference()!=ref] # every object has its own reference in SearchableText
#def cached_getWikiPredecessorValueList():
#lst=self.DMS_findPredecessors()
#lst=[r.getObject() for r in lst]
#di=dict.fromkeys(lst) # make it unique
#ref=self.getReference()
#return [o for o in di.keys() if o.getReference()!=ref] # every object has its own reference in SearchableText
#cached_getWikiPredecessorValueList=CachingMethod(cached_getWikiPredecessorValueList,
#id='DMSFile_getWikiPredecessorValueList')
#return cached_getWikiPredecessorValueList()
security.declareProtected(Permissions.View,'getContributorList')
def getContributorList(self):
#'''
#override
#'''
'''
override
'''
return (self.getContributorRelatedTitleList() or [])+(self.getContributorNameList() or [])
getContributorsList=getContributorList
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment