Thanks for you reply. I'll have a try. On Wed, Jan 21, 2009 at 5:30 AM, Anthony <[email protected]> wrote:
> > You need to convert the inequality filter on date to something that > can use an "=" filter, a couple of ways of doing this.. > > One way is to add a 'recent' list of date to the model, so instead of > storing just the publish day, store recent = [day,day-1,day-2,day-3] > etc. as a list - the number of recent days in this will determine how > many days your looking back on and limit your results to those days, > you can then 'recent=yesterday', and order by your liked. > > You could do a similar thing by storing a 'week' or 'month' property > and just filtering by items in the current week. Sites like youtube > tend to have popular today, this week, this month.. then you still > have your 'liked' free to do order on. > > Or run a query every few minutes to go through and flag items as > recent or not, then just 'recent=true'. You will have to do this onto > the back of requests and batch things at the moment, hopefully some > cron style scripts are coming soon to automate this. > > These methods are never going to be exact, but it will get you close > enough if your trying to filter all 'recently liked images' which is > what I'm guessing your doing. > > Anthony > > > > > > > > On Jan 21, 3:17 am, kang <[email protected]> wrote: > > Then, how can I do the hot thing? > > The image class has a datetime property 'date' and a int property > 'liked'. I > > need to get the images after yesterday and then order them by liked. > Thanks. > > > > On Tue, Jan 20, 2009 at 1:58 PM, ryan > > <[email protected] <ryanb%[email protected]>< > ryanb%[email protected] <ryanb%[email protected]>> > > > > > > > > > wrote: > > > > > On Jan 20, 6:05 am, "Barry Hunter" <[email protected]> > > > wrote: > > > > Its not strictly a gql limitation, but rather a datastore limitation. > > > > > > > http://code.google.com/appengine/docs/python/datastore/queriesandinde... > > > > > correct. if you have both inequality filter(s) and sort order(s), the > > > first sort order must be on the same property as the inequality filter > > > (s). this is a fundamental datastore limitation, unfortunately, and > > > one that we have no plans to remove any time soon. > > > > > > If your 'date' property really is a date, and not a date+time, you > > > > should be ok. > > > > > actually, this limitation is unrelated to property type. (hopefully > > > i'm just misunderstanding your point here...) > > > > -- > > Stay hungry,Stay foolish. > > > -- Stay hungry,Stay foolish. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---
