version 1.41, 2004/04/16 09:45:32
|
version 1.42, 2004/04/16 10:12:15
|
Line 743 class ECHO_collection(Folder, Persistent
|
Line 743 class ECHO_collection(Folder, Persistent
|
|
|
setECHO_collectionInformation(self,title,label,description,contentType,responsible,credits,weight,coordsnew) |
setECHO_collectionInformation(self,title,label,description,contentType,responsible,credits,weight,coordsnew) |
|
|
|
self.coords=coordsnew[0:] # HACK fehler in setECHO_collection |
|
|
self.sortfield=sortfield |
self.sortfield=sortfield |
|
|
Line 815 class ECHO_collection(Folder, Persistent
|
Line 815 class ECHO_collection(Folder, Persistent
|
|
|
return ids |
return ids |
|
|
<<<<<<< ECHO_collection.py |
|
getSubCols = ECHO_helpers.getSubCols |
|
======= |
|
def getSubCols(self,sortfield="weight"): |
|
|
|
subColTypes=['ECHO_group','ECHO_collection','ECHO_externalLink','ECHO_resource'] |
|
ids=[] |
|
for entry in self.__dict__.keys(): |
|
object=getattr(self,entry) |
|
try: |
|
if object.meta_type in subColTypes: |
|
ids.append(object) |
|
|
|
except: |
|
"""nothing""" |
|
try: |
|
sortfield=self.sortfield |
|
except: |
|
"""nothing""" |
|
|
|
tmplist=[] |
getSubCols = ECHO_helpers.getSubCols |
for x in ids: |
|
if hasattr(x,sortfield): |
|
try: |
|
x=int(x) |
|
except: |
|
"""nothing""" |
|
tmp=getattr(x,sortfield) |
|
else: |
|
tmp=10000000 |
|
tmplist.append((tmp,x)) |
|
tmplist.sort() |
|
return [x for (key,x) in tmplist] |
|
|
|
|
|
|
|