[Zope] Initialization of properties in a ZClass instance?

Darran Edmundson Darran.Edmundson@anu.edu.au
Tue, 14 Sep 1999 18:15:05 +1000


I have created a NewsItem ZClass for encapsulating updates
on my research for my collaborators to view.  NewsItem
is subclassed from ZObjectManager, can contain only DTML 
methods and images, and should possess a number of properties 
including the "date".

The problem is that
/Products/NewsItemProduct/NewsItemClass/propertysheets/common/NewsItemProperties
will not allow me to add a "date" property of type date and
leave it blank.  Ideally, I would like this property to
default (ie. automatically initialize) to the current datetime.
How does one achieve this?  (My guess is that I give it a
dummy value in the class definition and then set it in the
constructor method?).

This raises the question: does every object instance have
a creation datetime even though it doesn't explicitly appear
on the Properties tab, and if so, is this value available
in a DTML method.

On an unrelated note, how can I make each instance of NewsItem's
index_html method autmatically visible in the Contents tab and
available for editing?

Any help is much appreciated.

Darran.

P.S. Any commentary and the benefits/pitfalls of the Class
I propose are most welcome.

-- 
Darran Edmundson [Darran.Edmundson@anu.edu.au]