[Silva-general] code source: error 500

Marc Petitmermet petitmermet at mat.ethz.ch
Sun Mar 5 20:35:47 CET 2006


dear list members

i have a problem which drives me nuts. i want to create an  
automatically populated list field in a code source. this works like  
a charm with the following code:

mycontainer = context.get_container()
return [(item.getId(),item.getId()) for item in  
mycontainer.objectValues(['Silva File'])]

this creates a pull-down menu listing all silva files in the context  
of the code source. this returns the silva files in the same folder  
where the code source has been placed. but i want a list of silva  
files which are in the same folder where the code source has been  
included in a silva document. to achieve this, i use the model:

mycontainer = context.REQUEST.model.get_container()
return [(item.getId(),item.getId()) for item in  
mycontainer.objectValues(['Silva File'])]

this returns exactly what i want. but when i add/save the code source  
in a silva document i get the following error:

"post failed with unhabdled status 500"

what's wrong with the above code; it works perfectly in a page  
template. is this a bug in SilvaExternalSources?

(the problem appears in silva-1.1.5 as well as silva-1.4.2)

regards,
marc




More information about the Silva-general mailing list