python - SQLAlchemy Datetime Differences -


in sqlalchemy, can query similar to:

self.session.query(jobsrunning).filter((datetime.datetime.utcnow() - jr.start_time) > datetime.timedelta(hours=3)).all() 

this fails because i'm assuming datetime.datetime.utcnow() returns double after being subtracted jr.start_time. there way around without pulling datetime.datetime.utcnow() outside of query itself?

for some, may make query cleaner.


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -