Empty Query Results

20 views
Skip to first unread message

billguy

unread,
Jan 10, 2012, 10:38:53 AM1/10/12
to Google App Engine
More often than not, my queries return empty despite there being data
in the datastore. No errors are logged either (that I can see). Am I
doing something wrong?

---

class Notes(db.Model):

description=db.StringProperty(required=False)
start_date=db.DateProperty(default=datetime.datetime.now())
point_person=db.StringProperty(required=False)
default_end=datetime.datetime.now() + relativedelta( months = 1 )

end_date=db.DateProperty(default=datetime.date(default_end.year,default_end.month,default_end.day))
end_dates=db.StringProperty(required=False)
user=db.UserProperty()

---

c=Notes.all()
c.filter("user =",self.user)
c.filter("start_date >=",datetime.date(self.year,self.month,1))
c.filter("start_date
<",datetime.date(int(next_month.strftime('%Y')),int(next_month.strftime('%m')),
1))
current = c.fetch(20)

---

billguy

unread,
Jan 12, 2012, 10:00:47 AM1/12/12
to Google App Engine
bump

Simon Knott

unread,
Jan 12, 2012, 10:47:55 AM1/12/12
to google-a...@googlegroups.com
Hi,

A few questions:
  • What datastore are you running against, Master/Slave (M/S) or High Replication (HR)?
  • If it's the latter, how quickly are you querying for the data after it has been inserted?
  • Are you facing this issue on the development environment or in production?
Cheers,
Simon

billguy

unread,
Jan 12, 2012, 11:21:29 AM1/12/12
to Google App Engine
Thanks for the reply.
I'm on HR.
Data was inserted days ago. Sometimes queries return results,
sometimes they don't - random.
It worked fine in development, problem noticed in production.

Should I be querying 'DateProperty' differently than what I previously
cited?

On Jan 12, 9:47 am, Simon Knott <knott.si...@gmail.com> wrote:
> Hi,
>
> A few questions:
>
>    - What datastore are you running against, Master/Slave (M/S) or High
>    Replication (HR)?
>    - If it's the latter, how quickly are you querying for the data after it
>    has been inserted?
>    - Are you facing this issue on the development environment or in
>    production?
>
> Cheers,
> Simon
Reply all
Reply to author
Forward
0 new messages