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): ...@@ -232,16 +232,22 @@ class DMSFile(XMLObject,File):
getWikiSuccessorValueList - the way to find objects is on getWikiSuccessorValueList - the way to find objects is on
implementation level implementation level
''' '''
def cached_getWikiSuccessorValueList(): lst=[]
lst=[] for ref in self.getWikiSuccessorReferenceList():
for ref in self.getWikiSuccessorReferenceList(): res=self.DMS_findDocument(ref)
res=self.DMS_findDocument(ref) if len(res)>0:
if len(res)>0: lst.append(res[0].getObject())
lst.append(res[0].getObject()) return lst
return lst #def cached_getWikiSuccessorValueList():
cached_getWikiSuccessorValueList = CachingMethod(cached_getWikiSuccessorValueList, #lst=[]
id='DMSFile_getWikiSuccessorValueList') #for ref in self.getWikiSuccessorReferenceList():
return cached_getWikiSuccessorValueList() #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') security.declareProtected(Permissions.View, 'getWikiPredecessorValueList')
def getWikiPredecessorValueList(self): def getWikiPredecessorValueList(self):
...@@ -250,21 +256,26 @@ class DMSFile(XMLObject,File): ...@@ -250,21 +256,26 @@ class DMSFile(XMLObject,File):
document, and on how a doc must reference me to be my predecessor (reference only, document, and on how a doc must reference me to be my predecessor (reference only,
or with a language, etc or with a language, etc
''' '''
def cached_getWikiPredecessorValueList(): lst=self.DMS_findPredecessors()
lst=self.DMS_findPredecessors() lst=[r.getObject() for r in lst]
lst=[r.getObject() for r in lst] di=dict.fromkeys(lst) # make it unique
di=dict.fromkeys(lst) # make it unique ref=self.getReference()
ref=self.getReference() return [o for o in di.keys() if o.getReference()!=ref] # every object has its own reference in SearchableText
return [o for o in di.keys() if o.getReference()!=ref] # every object has its own reference in SearchableText #def cached_getWikiPredecessorValueList():
cached_getWikiPredecessorValueList=CachingMethod(cached_getWikiPredecessorValueList, #lst=self.DMS_findPredecessors()
id='DMSFile_getWikiPredecessorValueList') #lst=[r.getObject() for r in lst]
return cached_getWikiPredecessorValueList() #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') security.declareProtected(Permissions.View,'getContributorList')
def getContributorList(self): def getContributorList(self):
#''' '''
#override override
#''' '''
return (self.getContributorRelatedTitleList() or [])+(self.getContributorNameList() or []) return (self.getContributorRelatedTitleList() or [])+(self.getContributorNameList() or [])
getContributorsList=getContributorList 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