Querying datetime.datetime on appengine acts different then dev server help!

Posted by Alon Carmel on Stack Overflow See other posts from Stack Overflow or by Alon Carmel
Published on 2010-05-14T08:15:39Z Indexed on 2010/05/15 16:04 UTC
Read the original article Hit count: 299

Filed under:
|

Hey, I'm having some trouble with stuff that work locally and dont work on the app engine python environment:

Basically, i want to get a program from an epg between ranges of date and time. i know i cannot do two where > < so i saw a suggestion to save the dates as list as datetime.datetime which i did.

[datetime.datetime(2010, 5, 10, 14, 25), datetime.datetime(2010, 5, 10, 15, 0)]

This is ok. but when i try to compare to it:

progranon = get_object(Programs2Channel, 
                           'channel_id =', channelobj.key(),
                           'endstartdate >', programstart_minex, 
                           'endstartdate <', programstart_minex
                           )

This for some reason works locally, but fails to retrieve the data on the app engine.

*Im using Google app engine django patch which uses the get_object to retrieve data in transactions.

Please help.

Here are more details:

this is the LIST:

[datetime.datetime(2010, 5, 13, 10, 45), datetime.datetime(2010, 5, 13, 11, 30)]

#this is the query:

programstart = ""+year+"-"+month+"-"+day+" "+hour+":"+minute
programstart_minex = datetime.strptime(programstart, "%Y-%m-%d %H:%M")

progranon = Programs2Channel.gql('WHERE channel_id = :channelid AND endstartdate > :programstartx AND endstartdate < :programstartx',channelid = channelobj.key(),programstartx=programstart_minex).get()

© Stack Overflow or respective owner

Related posts about python

Related posts about google-app-engine