In that case, you would not be able to do inequality filters on both dates.
You may be able to work around this by storing the start and end date in two
separate entities, and referencing one from the other.  Then you can do one
inequality filter on the start date, and one on the end date.

-Marzia

On Wed, Oct 22, 2008 at 12:53 AM, Chris Spencer <[EMAIL PROTECTED]> wrote:

>
> Thanks. But as I said, I have two properties, a start and end date.
>
> On Wed, Oct 22, 2008 at 2:11 AM, Marzia Niccolai <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > Date ranges shouldn't be a problem, as you can do multiple inequality
> > filters with App Engine, as long as they are on the same property:
> >
> http://code.google.com/appengine/docs/datastore/queriesandindexes.html#Restrictions_on_Queries
> >
> > -Marzia
> >
> > On Tue, Oct 21, 2008 at 8:17 PM, Chris <[EMAIL PROTECTED]> wrote:
> >>
> >> How do you query date ranges? Say I have an object with a start date
> >> and end date. How do I query objects whose range falls on
> >> date.today()?
> >>
> >> On Aug 30, 4:45 am, fdezjose <[EMAIL PROTECTED]> wrote:
> >> > I've found a solution to my case. I had to query on two properties:
> >> > latitude and longitude, surfing the net I discovered this thing called
> >> > Geohash (http://en.wikipedia.org/wiki/Geohash) so now I have a
> geohash
> >> > property that I can query without any problem.
> >> >
> >> > This blog post was also
> >> > useful:
> http://labs.metacarta.com/blog/27.entry/geographic-queries-on-google-...
> >> >
> >> > Thanks,
> >> >
> >> > José Luis
> >> >
> >> > On Aug 28, 10:33 pm, Davide Rognoni <[EMAIL PROTECTED]> wrote:
> >> >
> >> > > I don't like this "Restrictions on Queries" :-(
> >> >
> >> > > On Aug 28, 10:26 pm, Nevin Freeman <[EMAIL PROTECTED]> wrote:
> >> >
> >> > > >
> >> > > > From:
> http://code.google.com/appengine/docs/datastore/queriesandindexes.html
> >> >
> >> > > > "The query mechanism relies on all results for a query to be
> >> > > > adjacent
> >> > > > to one another in the index table, to avoid having to scan the
> >> > > > entire
> >> > > > table for results. A single index table cannot represent multiple
> >> > > > inequality filters on multiple properties while maintaining that
> all
> >> > > > results are consecutive in the table."
> >> >
> >> > > > Nevin
> >> >
> >> > > > On Aug 28, 1:23 pm, Davide Rognoni <[EMAIL PROTECTED]>
> wrote:
> >> >
> >> > > > > Why this limitation?
> >> >
> >> > > > > On Aug 28, 10:17 pm, Nevin Freeman <[EMAIL PROTECTED]>
> >> > > > > wrote:
> >> >
> >> > > > > > José,
> >> >
> >> > > > > > Many different workarounds are available, depending on your
> >> > > > > > circumstances. The simplest (not ideal) thing to do would be
> to
> >> > > > > > run
> >> > > > > > two queries and then take the intersection of the two results,
> >> > > > > > i.e.:
> >> >
> >> > > > > > q1 = Model.gql("WHERE prop1 < :1", number1)
> >> > > > > > q2 = Model.gql("WHERE prop2 > :1", number2)
> >> >
> >> > > > > > batch1 = q1.fetch(1000)
> >> > > > > > batch2 = q2.fetch(1000)
> >> > > > > > result = []
> >> >
> >> > > > > > for entity in batch1:
> >> > > > > >   if entity in batch2:
> >> > > > > >     result.append(entity)
> >> >
> >> > > > > > return result
> >> >
> >> > > > > > If you give us a little more context, maybe people who have
> >> > > > > > similar
> >> > > > > > situations can share with you how they have dealt with the
> >> > > > > > limitation.
> >> > > > > > In my case, I had to change the way I store my data so that I
> >> > > > > > can get
> >> > > > > > the right results with only one inequality operator per query
> >> > > > > > (but
> >> > > > > > name equality operators).
> >> >
> >> > > > > > Nevin
> >> >
> >> > > > > > On Aug 28, 12:07 pm, fdezjose <[EMAIL PROTECTED]> wrote:
> >> >
> >> > > > > > > Hello! I'm new in the App Engine world and I've run into an
> >> > > > > > > issue
> >> > > > > > > that's driving me crazy. I need to compare two properties
> (ex.
> >> > > > > > > propertyA > 4 AND propertyB > 8) But by doing that I've
> >> > > > > > > discovered
> >> > > > > > > that only one property per query may have inequality
> >> > > > > > > filters... Any
> >> > > > > > > suggestion or workaround to be able to accomplish this task?
> >> >
> >> > > > > > > Thanks!
> >> >
> >> > > > > > > José Luis
> >>
> >>
> >
> >
> > >
> >
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to