Fw: Re: [Zope] Zope and Objects

Michael Long mlong@datalong.com
Wed, 26 Mar 2003 11:56:31 -0500


If the online documentation is not quite enough I would recommend the
Zope Bible. The chapters on building zope products are very good. I have
just finished creating the AddressBook example in the book but instead
of using DTML I used ZPT. I also incorporated a style sheet. It was an
interesting exercise. Unfortunately I could not get the security model
explained in the book to work right.

This is my first attempt at creating a product and if anyone would care
to look over this code and give any feedback I would be greatful.

Cheers,
Mike

> Jeff Childers wrote:
> 
> > I'm starting to get the "big picture" but I'm still a little fuzzy on 
> > the details, particularly about objects and the ZODB. I'm hoping that 
> > someone can give me some brief pointers to where the answers the these 
> > questions lie. I have read a *bunch* of Zope doc and I'm pretty handy 
> > with Python.
> >
> > 1) Where are data object classes defined in Zope?
> 
> 
> > I get the persistent object thing. Very cool. So let's say I want to 
> > write a billing system. I have customer objects, invoice objects, and 
> > payment objects. [ Customer [ Invoices [Payments] ] ].
> >
> > a) Where do I put the code that defines each custom class? Scripts 
> > seem to be for def-functions. Do I have to put this outside Zope? 
> 
> 
> 
> You need to write a Zope product i Python to do these things. There is a 
> good overview here:
> 
> http://www.zope.org/Documentation/comp_tut
> 
> > b) Do I use ZCatalogs to 'index' my objects so I can query them 
> > similar to SQL? If so, how/where do I add my custom classes to the 
> > ZCatalog? 
> 
> 
> 
> Your classes should just subclass "CatalogPathAware" and they are 
> automatically catalog aware. If you use this tool to write your 
> products, they are so automatically:
> 
> http://www.zope.org/Members/maxm/HowTo/easyProduct
> 
> > 2) How do I instantiate and persist (through the session) a particular 
> > instance of the class from the ZODB (i.e. a certain customer)? 
> 
> 
> 
> When you write your products, you also write a "constructor" function, 
> which does it for you.
> 
> regards Max M
> 
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
> 
>