[Zope] ZClass issue

Kevin Dangoor kid@kendermedia.com
Tue, 15 Feb 2000 10:50:24 -0500


Hi, John

----- Original Message -----
From: "John E. Vincent" <john@lusis.org>
To: <zope@zope.org>
Sent: Monday, February 14, 2000 12:31 AM
Subject: [Zope] ZClass issue


> Okay I've been pouring over documentation for the past week and I just for
> the life of me cannot figure this out. I had originally created a product
> to do what I needed it to do but found a reference that ZClass might be
> easier. Basically what I have is a ZClass that will allow a user to create
> a template for thier site. The class allows them to upload 4 separate
> images as well as give the site a title. Now what I want to do is be able
> to call this ZClass via a link to it directly or or a link to a method
> which itself calls the ZClass.

Let me make sure I've got this straight... You're creating an ObjectManager
ZClass that will contain 4 images and a title property. Is that right?

> I've been reading the "Adding ZClass Instances Programmatically" doc for
> about 3 hours and I'm about fried from it. There has to be something
> obvious here. Basically I have a method that contains these 3 lines:

I'm not completely sure that that HowTo (which I wrote) is what you're
looking for. For most cases, you can add ZClass instances quite conveniently
through the normal Zope management screens. The basic ZClass configuration
with the addForm and the Factory makes this easy. The HowTo covers the case
where you need to create ZClass instances as part of some larger routine.

> <dtml-with "manage_addProduct['TemplateCreation']">
>   <dtml-call "templateCreate_addForm">
> </dtml-with>

The fact that you're calling addForm may imply that you're not trying to add
ZClass Instances via a program, but that you want to fill out the addForm
and then create the instance. Is that right? If so, that's what you get when
you try to do it via the management interface...

Kevin