[Zope] Newbie: creating objects programmatically

Richard Jennings rjennings@stradefi.com
Wed, 14 May 2003 13:36:40 +0200


Thanks Dmitry

>1) method document_src() requires no parameters  (self is passed implicitly 
by python)
>so you write
>context.['index_html'].write(context.memberIndex.document_src())

I tried this and got the error message mentioned, so I tried again with the 
explicit 'self' - no go.

>2) To create a page template with a content, you may pass it in constructor:
>container.manage_addProduct['PageTemplates'],manage_addPageTemplaate('index_html', 
text=context.memberIndex.document_src())

This is certainly more elegant and I had spotted it in ZopePageTemplates.py 
but I wanted to go step by step. 

However, neither of the solutions works for me because I always get the 
'Unauthorized' error message.  With my limited experience, I don't know how 
to start debugging this.  Can you help me again?

regards
Richard