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

cleanup and comments

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10445 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 094f01b9
...@@ -242,6 +242,7 @@ class DMSFile(XMLObject,File): ...@@ -242,6 +242,7 @@ class DMSFile(XMLObject,File):
getWikiSuccessorValueList - the way to find objects is on getWikiSuccessorValueList - the way to find objects is on
implementation level implementation level
''' '''
# XXX results should be cached as volatile attributes
lst=[] lst=[]
for ref in self.getWikiSuccessorReferenceList(): for ref in self.getWikiSuccessorReferenceList():
r=ref[1] r=ref[1]
...@@ -249,16 +250,6 @@ class DMSFile(XMLObject,File): ...@@ -249,16 +250,6 @@ class DMSFile(XMLObject,File):
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():
#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') security.declareProtected(Permissions.View, 'getWikiPredecessorValueList')
def getWikiPredecessorValueList(self): def getWikiPredecessorValueList(self):
...@@ -267,20 +258,12 @@ class DMSFile(XMLObject,File): ...@@ -267,20 +258,12 @@ 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
''' '''
# XXX results should be cached as volatile attributes
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():
#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()
# BG copied from File in case # BG copied from File in case
index_html = CMFFile.index_html index_html = CMFFile.index_html
......
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