Querying datetime.datetime on appengine acts different then dev server help!
- by Alon Carmel
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()