Hi,

I take back my previous comment, which would probably work, but not be the
best solution for searching through time periods.

Here's what I'd probably do instead.

Create a model:

class MyModel(db.Model):
  start_date = db.DateTimeProperty()
  end_date = db.DateTimeProperty()
  active_weeks = db.ListProperty(int)

If I had only a start_date, no end_date, I would set active_weeks = [-1],
meaning what you were searching for was active.  Once the end_date was
entered, I would compute the weeks my activity was active.  So, say, if it
was active Jan 1 - Jan 14, active_weeks = [1,2].

So if I wanted to find all activites that were happening between Jan 1 and
Jan 7, I would 'SELECT * FROM MyModel WHERE active_weeks = 1'.

This isn't directly related to the first comment, but the same principle can
probably still be applied to whatever properties you are trying to filter on
in this case.  Computation at put() time is your friend.

-Marzia

On Tue, Dec 2, 2008 at 2:01 PM, NoIEbrowser <[EMAIL PROTECTED]>wrote:

>
> I hope :-)
>
> On Dec 2, 7:32 am, Arun Shanker Prasad <[EMAIL PROTECTED]>
> wrote:
> > oh....
> >
> > Maybe someone else can point you to a better solution..
> >
> > On Dec 2, 1:10 am, NoIEbrowser <[EMAIL PROTECTED]> wrote:
> >
> > > I've 90'000 records 8-)
> >
> > > On Dec 1, 12:03 pm, Arun Shanker Prasad <[EMAIL PROTECTED]>
> > > wrote:
> >
> > > > Hi,
> >
> > > >   I think that inequality filter can be applied on only one of the
> > > > properties.
> >
> > > > query.filter('my_field1 >=',  123)
> > > > query.filter('my_field2 <=', 123)
> >
> > > >   In this case the filter can only be applied to my_field1. You may
> > > > have to fetch the result and then process it based on the second
> > > > property.
> >
> > > > On Nov 30, 8:49 pm, NoIEbrowser <[EMAIL PROTECTED]> wrote:
> >
> > > > > Hi All,
> > > > > I see the error when I run this code:
> >
> > > > > query = MyModel.all()
> > > > > query.filter('my_field1 >=',  123)
> > > > > query.filter('my_field2 <=', 123)
> > > > > print query.get()
> >
> > > > > I found this work around:
> >
> > > > > Marzia Niccolai: "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."
> >
> > > > > From:
> http://groups.google.com/group/google-appengine/browse_thread/thread/...
> >
> > > > > Can you post a query example, please?
> > > > > (When I will see the example: "Is this the best work around?")
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
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