[Zope] Z Classes

Tom Deprez Tom Deprez" <tom.deprez@village.uunet.be
Sat, 8 May 1999 16:31:10 +0200


Hi,

Amos, great job! Your tutorial of ZClasses certainly gave me a quick look on
the capabilities of Z Classes.

Following points maybe to add to your tutorial :

1. Before the tutorial begins, you maybe can describe what a ZClass needs
for getting it to work. (So all the methods it needs for liminary working).
Explain why these methods, properties are needed and how they are related to
each other and Zope. During the tutorial, there is lots of switching between
forms. If people know what they have to make or what it all means, they
understand it better. A drawing helps a lot!. Also perhaps situate where the
Classes are placed in Zope?

2.  Some small modifications?

Start by going to the Control Panel and creating a new Product.  Choose
"Product" from the add form and call it 'CDProduct'.
--> Start by going to *** the Product Management screen in *** the Control
Panel and creating a new Product....

~~~~~~~~~~

For the Class 'meta-type' specify 'CD'. 'meta-type' basically means Zope
Product type.
--> For the Class 'meta-type' specify 'CD' ***and click 'Change' ***. ......

~~~~~~~~~~

Creating a View

Now let's add a View to our class which will let use manage  these
properties.
--> *** Go back to the 'CDClass screen' ***. Now let's add a View to our
class which will let use manage  these properties.

~~~~~~~~~~

The final step is to create a Factory to put this add form into  the Product
add list. Choose 'Zope Factory' from the Product add
list and create a Factory with id 'CDFactory', add list name 'CD' and method
'addForm'.

--> The final step is to create a Factory to put this add form into  the
Product add list. *** Go to CDProduct screen ***. Choose 'Zope Factory' from
the Product add list and create a Factory with id 'CDFactory', add list name
'CD' and method 'addForm'.

~~~~~~~~~~

3. Maybe create also examples of the enhanced properties with CDProduct as
example.


************************* Other question **********************************

Now that we've ZClasses, is it possible to get this done? And how?

Assume we want to make a CD database. We just made are CDProduct ZClass (=
CDProduct object).
Now we want the users to add CD's to Zope.
They have 3 screens :

1. Adding CD's.
2. Removing CD's.
3. Show the CD's sorted on title or artist.

How can we store these? Can these be directly be stored into Zope? How?
Do we need a relational database? How to get this done?
Or in Zope's database?

Can somebody enhance Amos's tutorial which incorporates the q'ns above?
Thanks!!!!!

Regards, Tom.