If I have a model like:
class market(db.Model)
expires = db.DateTimeProperty()
class zones(db.Model)
name = db.StringProperty()
class siteuser(db.Model)
username = db.StringProptery()
zone = db.ReferenceProperty()
class MarketZone(db.Model)
market = db.ReferenceProperty(market)
zon
I have a problem. I'm getting datastore timeouts when doing reads. The
code finished about 5% of the time. The code looks like:
alerts = Alert.all().filter('expires >= ', datetime.datetime.now())
# ge active alerts
for alert in alerts:
#get the db.Keys from the ListProperty
zones = ZoneMaster
And, I should add, this works perfecty (and quickly) from the
development server's datastore.
On Apr 29, 8:31 am, tayknight wrote:
> I have a problem. I'm getting datastore timeouts when doing reads. The
> code finished about 5% of the time. The code looks like:
>
> alert
ere is no limitation on it...
>
>
>
>
>
> On Wed, Apr 29, 2009 at 11:56 PM, tayknight wrote:
>
> > And, I should add, this works perfecty (and quickly) from the
> > development server's datastore.
>
> > On Apr 29, 8:31 am, tayknight wrote:
> >
I figured out that I needed to do a
alerts = Alert.all().filter('expires >= ', datetime.datetime.now
()).fetch(1000)
Apparently it is faster to do a fetch() than iterate over the values.
On Apr 30, 7:28 pm, tayknight wrote:
> Data is returned in development almost instantly. In