[Zope] default date unknown

John Hunter jdhunter at ace.bsd.uchicago.edu
Mon Sep 27 16:15:41 EDT 2004


>>>>> "John" == John Hunter <jdhunter at ace.bsd.uchicago.edu> writes:

    John> I would be happy to use '' or None.  I found this post
    John> http://mail.zope.org/pipermail/zope-dev/2001-October/013476.html
    John> to handle None.  Is this the preferred approach?

I used this approach and am happy with it...

from ZPublisher import Converters


def date_or_none(val):
    if val.lower().strip() == 'none': return 'None'
    return Converters.field2date(val)
                                                                                                     
type_converters = Converters.type_converters
type_converters.update({'date'  : date_or_none})


More information about the Zope mailing list