[Zope] Newbie: ZClass is what I need?

Gilles Lenfant gilles@pilotsystems.net
Thu, 27 Mar 2003 16:50:03 +0100


----- Original Message -----
From: "Fabio Rolando" <ziofunk@tiscali.it>
To: <zope@zope.org>
Sent: Thursday, March 27, 2003 4:15 PM
Subject: [Zope] Newbie: ZClass is what I need?


> Hi.
>
> I am trying to develop a product and I need to define some kind of object
> having a fixed HTML structure and some extra properties. I have to provide
> users with an interface (into the Zope management console) to create
> instances, type the values for the properties, and browse the local
> filesystem to select the file that will be included into the fixed html
> structure.
>
> In other words when they create a new product they should be given an
> interface where they can put values for properties and browse a file on
> their filesystem. When they press the button the new objetc must be made
> available to readers.
>
> Can I do this using ZClass? How can I embed some predefined contents in
the
> ZClass? How can I have the instance to handle some uploadable contents?

You should make a ZClass that inherits from OFS:File and maybe from
ZCatalog:Catalogpathaware (if you want to have indexable/searcheable
objects)
You can add attributes through the propertysheets (types are limited to what
is supported by properties (string, int, date...).
You can predefine some content with the constructor (generally, a Python
script that's *outside* the ZClass).

--Gilles