-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 26.01.2009 6:23 Uhr, Jan Koprowski wrote:
> Hi !
> 
>   I get some query:
> 
> DELETE FROM passwordrequest WHERE requested_at <= (NOW() - INTERVAL 1
> DAY)
> 
> which delete all requests older then one day. How can I get this
> effect in SQLAlchemy ?
>

untested:

session = ...
PR = <mapper for passwordrequest>
for pr in
session.query(PR).filter(PR.requested_at<=(datetime.now()-datetime.timedelta(1)):
    session.delete(pr)

- -aj

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkl9UuQACgkQCJIWIbr9KYwtwQCgwciGZ91zVag/s9JRrQMdOXk2
nl4AoIz5ixXW9h3L4U7D2z6rMpmtwv9s
=oFIk
-----END PGP SIGNATURE-----

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

begin:vcard
fn:Andreas Jung
n:Jung;Andreas
org:ZOPYX Ltd. & Co. KG
adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany
email;internet:i...@zopyx.com
title:CEO
tel;work:+49-7071-793376
tel;fax:+49-7071-7936840
tel;home:+49-7071-793257
x-mozilla-html:FALSE
url:www.zopyx.com
version:2.1
end:vcard

Reply via email to