Okay, admittedly that is so -- but I'd still like to pass a default value. Most date/time systems have a way of specifying a "zero" date value that be tested for equality. Right now what I'm doing is testing against "1900/01/01 00:00:00.0000 GMT+1", which feels a little stupid. -- Alexander Staubo http://www.mop.no/~alex/ "`Ford, you're turning into a penguin. Stop it.'" --Douglas Adams, _The Hitchhiker's Guide to the Galaxy_
-----Original Message----- From: Brian Lloyd [mailto:Brian@digicool.com] Sent: 10. juni 1999 16:56 To: 'Alexander Staubo'; Zope Mailing List (E-mail) Subject: RE: [Zope] Optional date properties (Zope 1.11)
I thought I could add an optional date property to my Z Class' property sheet, but no -- it seems Zope requires that you fill in a valid date. Is there a workaround?
Isn't this inconsistent with other properties' behaviour, though? Wouldn't it be logical that an empty date value as entered in Zope's management screens would represent "None" or at least a generic "zero" date?
-- Alexander Staubo
I don't think that this is necessarily inconsistent - for example, if you try to add an int, float, etc. with no value you get:
exceptions.ValueError: Empty entry when integer expected
String and string-ish fields may _seem_ to act slightly differently in that they accept an empty value, but this is really not so different when you consider that '' is a valid string (in the same way that 0 would be a valid, but "empty" integer).
Brian Lloyd brian@digicool.com Software Engineer 540.371.6909 Digital Creations http://www.digicool.com