[albatross-users] newbie (coming from java) question

Gregory Bond gnb at itga.com.au
Wed Jun 2 10:32:06 EST 2004


A couple of things spring to mind.

pinted at tiscali.be said:
>         if ctx.req_equals('detail'):
>             ctx.set_page('detail')
>         if ctx.req_equals('recherche'): 

this should usually be elif - the set_page() call doesn't terminate the 
page_process function (tho depending on the html template, you may never hit 
the case where detail and recherche are both true...)

>	docInfoList = []
>       for result in container.searchContains('title',ctx.locals.title):
>                docInfoList.append(result)

Any particular reason this is not written as 
	docInfoList = container.searchContains(....)
(this is a general python nit not an albatross nit!)

Are you expecting the ctx.metaData to be in the session?  The code as written
will have a single metadata object that is recreated each time an HTTP request
is made (assuming this is a CGI and not, say, a mod_python script....) so any
changes made to the metaData object by the searchContents() function will be
lost.

pinted at tiscali.be said:
> My code does not work (what a shame !)

Apart from the above, it looks reasonable enough to me.  To go further, we'd
need a fair bit more info.  What "does not work'?  Does it throw exceptions?
What's broken?








More information about the Albatross-users mailing list