[Zope] Newbie: creating objects programmatically

Richard Jennings rjennings@stradefi.com
Tue, 13 May 2003 17:45:23 +0200


I am building a small application based on the "Build a simple ZClass (CatalogAware,
non-default Catalog, Folderish)" how-to, but entirely using ZPT - I don't want to
learn dtml!

The objectManager constructor works fine with the lines as follows:

instance = container.Directory.createInObjectManager(request['id'], request)
instance.manage_addDTMLMethod('index_html','',instance.def_index)

When I try to replace the dtml with:

instance.manage_addProduct['ZopePageTemplate'].manage_addZopePageTemplate('memberIndex.pt')

I get:Error Type: AttributeError
      Error Value: ZopePageTemplate 

when creating an instance of the ObjectManager ZClass.

I have read many of the how-tos available, including the DTML to ZPT Conversions and
hacked a lot but I can't find my error.  Can someone help me please?

Regards