[Zope] newbie ?: zclass propertysheet datatypes

Tres Seaver tseaver@palladion.com
Wed, 03 May 2000 16:45:38 -0500


Daniel Chudnov <daniel.chudnov@yale.edu> wrote:
 
> Trying to add a date property to a class, Zope's giving me an "Invalid
> Date-Time String" when I leave the initial value blank.  Is this a
> configuration problem (rh6.0, Zope 2.1.6 w/zserver) or by design?  There
> shouldn't be a default value for this property in the interface I'm
> building...

This is actually a problem with ZPublisher's marshalling code, rather than the
property sheet per se.  There is a bug in the Collector describing it:

  http://classic.zope.org:8080/Collector/645/view

The workaround is to supply a "bogus" value ('1970/01/01' is the one I most
often use) for the property, and then in the "edit" method, to add code checking
for the bogus value::

  <dtml-if "REQUEST[ 'dateProperty' ] == _.DateTime( '1970/01/01' )">
    <dtml-call "REQUEST.set( 'dateProperty', None )">
  </dtml-if>

-- 
=========================================================
Tres Seaver  tseaver@digicool.com   tseaver@palladion.com