Questions tagged [app-engine-ndb]

NDB is a better datastore API for the Google App Engine Python runtime. It provides an improved interface over ext.db, and includes support for parallel processing with coroutines.

NDB is a better datastore API for the Google App Engine Python runtime, and currently a standard component of the App Engine Python SDK and the Python runtime.

The NDB API provides persistent storage in a schemaless object datastore. It supports automatic caching, sophisticated queries, and atomic transactions. NDB is well-suited to storing structured data records.

Documentation.

Conversion guide from old db.

Original [deprecated] project.

1288 questions
0
votes
1 answer

AppEngine NDB property validations

I wonder what the best approach is for validating NDB entity properties likes: a date must be in the future a grade (integer property) must be between 1 and 10 a reference to another entity must have certain property values (e.g.…
0
votes
1 answer

How can I fetch the lastest entry of a model new put into NDB?

How can I get the latest entry of a model new putted into NDB? 1: If I use a same parent key ? How to ? I see the document write Entities whose keys have the same root form an entity group or group. If entities are in different groups, then…
0
votes
1 answer

blob_send save_as=True fails after converting from db to ndb

I converted nicks blog example to ndb now this line fails: self.send_blob(file_info.blob, save_as=True) with this error: ValueError: Expected BlobInfo value for blob_key_or_info. Rest of the class: class…
user784435
0
votes
1 answer

Comparing a key to a KeyProperty in ndb

I'm trying to make a query comparing a key but i don't get any results. I have a Tutorial and a Chapter Model. The chapter Model contais a keyProperty of kind Tutorial. ( tutKey = ndb.KeyProperty(kind='Tutorial')) tutID =…
mFontoura
  • 257
  • 2
  • 15
0
votes
1 answer

Data Modeling - modeling an Append-only list in NDB

I'm trying to make a general purpose data structure. Essentially, it will be an append-only list of updates that clients can subscribe to. Clients can also send updates. I'm curious for suggestions on how to implement this. I could have a ndb.Model,…
Murph
  • 1,479
  • 2
  • 13
  • 26
0
votes
1 answer

NDB Parallel Tasklets

Please take a look at this parallel tasklet code snippet #1. @ndb.tasklet def get_data_parallel(e): usr, det = yield (e.user.get_async(), MyKind.query(ancestor = e.key).fetch_async()) raise…
0
votes
1 answer

Storing Data - Big list into entity properties

I run a crawler back-end in my application that everyday mines some websites for data. For every website I crawl I create an entity, stores a big list of String id's. Approximation is around 2.000 per entity. Around 1000 entities per day. The…
0
votes
1 answer

AppEngine NDB PolyModel getting properties

I am having a problem with appengine that I can't seem to figure out: from google.appengine.ext import ndb from google.appengine.ext.ndb import polymodel class Item(polymodel.PolyModel): name = ndb.StringProperty() type =…
Jon
  • 734
  • 1
  • 7
  • 30
0
votes
1 answer

Understanding AppEngine _ah/stats result

I have this result in App Stats for AppEngine, and I can't work it out, it looks like each part performs ok, but there is a huge gap. Any Ideas? Context: It's a registration system, it checks if the username/email already exists, send an email to…
Chris
  • 2,739
  • 4
  • 29
  • 57
0
votes
1 answer

python Channel API expiry and usage in google app engine

I want to use the channel api to push updates to open pages, What I have done so far is to store the page client ids in ndb - I have included a code summary My question is: How do I manage closed pages and expired tokens? and is this the best way to…
user784435
0
votes
1 answer

Google Appengine / Django / NDB setup throws mysqldb error on server start

I'm running Django 1.3 in a virtualenv with python 2.7 on OSX Mountain Lion. When I run dev_appserver.py I get this thrown at me. (Ignore the warning about the images API. Question: Why am I getting a mysqldb warning when I'm using ndb? Question:…
mehulkar
  • 4,895
  • 5
  • 35
  • 55
0
votes
2 answers

Dereference Models from many to many relationship

In my schema, as described in the below test data generation example, I want to know a good way to: Dereference all instances of Favourites that have reference keys to instances of Pictures that have been deleted. Just delete any Favourite that…
Jimmy Kane
  • 16,223
  • 11
  • 86
  • 117
0
votes
1 answer

performance implications of transactions on large entity groups (python, NDB, Master/Slave)

I have several tens of thousands of related small entities (NDB atop of Master-Slave, will have to move to HRD one day..), which I'd like to put in the same entity group to enable transactions. Small subsets of those entities will be updated by…
0
votes
2 answers

NDB query periodically not finding entity

I have an account key that I check when processing items. This key prevents me from spending time working on items that are no longer valid. On an inner loop in processing, I validate that I can still find the key that I am working on. Entity…
TheJacobTaylor
  • 4,063
  • 1
  • 21
  • 23
0
votes
1 answer

app engine datastore transaction exception

In app engine transactions documentation I have found the following note: Note: If your app receives an exception when submitting a transaction, it does not always mean that the transaction failed. You can receive Timeout,…