Thank you howesc :) As you said, I used select().sort(lambda message:message.reg_time,reverse=True)
2012년 8월 21일 화요일 오전 7시 55분 17초 UTC+9, howesc 님의 말: > > you may also do orderby=db.mibmessage.end_time|~db.mibmessage.reg_time - > that is a legal sort on GAE, it may not be what you want though. > > you know about select().sort(lambda r:...) right? i use that on GAE to > get around extra indexes and illegal sorts. :) > > On Monday, August 20, 2012 7:20:05 AM UTC-7, JungHyun Kim wrote: >> >> Hello everyone! >> >> I have question about order by option with GAE. >> This code works well on my local (not GAE test server), but has problem >> on google app engine. (even on the GAE local test server) >> >> I filtered messages which has end_time after now, and tried to sort them >> by reg_time. >> >> messages = db(db.mibmessage.end_time >= datetime.now()).select( >> orderby=~db.mibmessage.reg_time) >> >> But there was an internal error. >> >> <class 'google.appengine.api.datastore_errors.BadArgumentError'> First >>> ordering property must be the same as inequality filter property, if >>> specified for this query; received reg_time, expected end_time >> >> >> Is it GAE's limitation? >> >> Should I sort them by myself ? >> >> >> >> --

