[Zope] Creating nested ZClass programmatically

Kees de Brabander cj.de.brabander@hccnet.nl
Wed, 2 Jan 2002 21:40:22 +0100


Hi,
----- Original Message -----
From: "Nick Gaunt" <gauntn@eurobell.co.uk>
To: <zope@zope.org>
Sent: Wednesday, January 02, 2002 12:33 PM
Subject: [Zope] Creating nested ZClass programmatically


> Hi
>
> First of all, Happy New Year to you all!

from me to

> I am trying to grok ZClasses. I have created a set of classes as follows:
>
> StudySite
>     |
>     Study
>         |
>         StudyArm
>         |
>         SubjectFolder
>             |
>             Subject
>
> I can create instances of each nested class successfully through the
> management interface. Now I want users to be able to add instances via a
> standard user interface, but I cannot work out how to do so. I have users
> navigate to the desired Study, click an "Add Subject" button that opens a
> form to collect subject details, click "Add" to open a DTMLMethod, and
then I
> come unstuck - whatever dtml-call syntax I try returns "global name
> 'StudySite' is not defined". I assume I am not accessing the ZClass
> namespace, but what is the syntax?
>

Since you did not share with us the code you used, I'm not sure what your
problem is, but may be it is the same that I experienced a while ago:

 <dtml-with "manage_addProduct['Productname']">
   call your class_add method here
 </dtml-with>

'Productname' should be the name of your product as it appears in the
'Products' folder and not the matatype of your class
hth, cb