[storm] setting a database timestamp
Duncan M. McGreggor
duncan.mcgreggor at gmail.com
Wed Apr 22 02:21:56 BST 2009
Martin DeMello wrote:
> On Wed, Apr 22, 2009 at 6:35 AM, Duncan M. McGreggor
> <duncan.mcgreggor at gmail.com> wrote:
>> I think you're going to love this :-) This is actually one of my
>> favorite little features of Storm.
>>
>> To create a Python Storm function for a database function, all you need
>> to do is import NamedFunc, subclass it, and define the function name.
>> You can then use it in Storm Python expressions.
>>
>> For example:
>>
>> from storm.expr import NamedFunc
>>
>>
>> class CurrentTimestamp(NamedFunc):
>> __slots__ = ()
>> name = "CURRENT_TIMESTAMP"
>>
>> Hope that helps!
>
> That's wonderful, thanks :)
>
> martin
Sorry list, I'm not used to the list address not being the default reply-to.
Martin, as much as I love this feature of Storm, James' solution (which
I didn't know about!) is (clearly) even more concise.
d
More information about the storm
mailing list