[Zope] Creating a New Object Type - Use ZClass or Python?

Kevin Dangoor kid@kendermedia.com
Fri, 30 Jul 1999 11:01:31 -0400


-----Original Message-----
From: Anthony Pfrunder <s341625@student.uq.edu.au>
To: eric jones <ej@ee.duke.edu>
Cc: zope@zope.org <zope@zope.org>
Date: Friday, July 30, 1999 7:43 AM
Subject: Re: [Zope] Creating a New Object Type - Use ZClass or Python?


>On Fri, 30 Jul 1999, eric jones wrote:
>
>[snip]
>> I'd like the Add form to have places for adding all the basic properties.
>> The paper title, journal name, and description are pretty straight
forward I
>> think.  The authors are a little more troubling.  I'd like to make them a
>> list of tuples:
>[snip, snip]
>
>In my opinion Zclasses are _far_ easier than Python, also, you can edit it
>on the fly and watch the changes in real-time.  WRT your application, I
>suggest that you create a Zclass which subclasses XML Document.  Put the
>instance within a Zcatalog search folder. Zcatalog
>is the bit that adds searching (see zope list for an
>example from the kind DC souls...) and XML allows you to create a
>structured document with your own tags.  My guess (ie haven't tried it) is
>that Zcatalog can be made to index on the properties exposed by XML and
>then you can index on Author and create an appropiate sequence of results
>as required.

[more deleted]

I agree that ZClasses are much easier than Python. Of course, every solution
can have a million possible alternates, and this one is no different.

One possibility: make a standard ZClass (ie no explicit subclassing) and add
the necessary fields on a propertysheet. The Author could be a lines
property so that each author's name is distinct. The Catalog should be able
to search this.

If there was a way to "link" from one ZClass instance to another, then you
could have an Author object for each author and just have the publication
point to the Author object. There are certainly ways to do this
programmatically now, it's just not automatic. This way, an Author could
have other properties (contact info, website address, etc.) if desired, and
those properties are only stored in one place.

Kevin