[Zope] A date type for ZSQLMethods?

Neil Burnett neil@efc.be
Sun, 24 Jun 2001 22:19:09 +0200


Frequently, I need the following syntax in ZSQLMethods:

<dtml-sqlvar LastModified type="date">
                                ^^^^
Where LastModified is a string suitable for conversion to a DateTime
instance and #mm/dd/yyyy hh:mm:ss# is returned.

I am getting there by using:

<dtml-var expr="_.DateTime(LastModified).strftime('#%m/%d/%y %H:%M:%S#')">

but it took forever to work that out (with loads of help from people on this
list - thanks).

Is this a sensible addition to the ZSQLMethod product, or is there a better
way that I have missed?

If so, would I patch the original (not my idea of fun:-) or subclass SQLVar?
As a member of the Python illiterati - I've got the Programming Python book,
but haven't fully grasped it yet - I wouldn't mind some clues on how to do
this. Not urgent, of course.

Regards

Neil