On Wed, Apr 22, 2009 at 6:44 AM, James Henstridge <[email protected]> wrote:
> On Wed, Apr 22, 2009 at 8:43 AM, Martin DeMello <[email protected]>
> wrote:
>> How do I access postgresql's CURRENT_TIMESTAMP function from storm?
>> That is, I want a table with a datetime column updated with the
>> server's current time, not datetime.now() on the client.
>
> Try the following:
>
> from storm.expr import SQL
>
> CURRENT_TIMESTAMP = SQL("CURRENT_TIMESTAMP")
Nice. And for the benefit of anyone googling this, I solved the second
part of my problem too -
store.find(User, (SQL("CURRENT_TIMESTAMP") - User.last_updated > '1 00:00:00'))
will find all users who haven't been active in the last day.
martin
--
storm mailing list
[email protected]
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/storm