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

ndb independent transactions and retry

I have a problem finding a detailed explanation of datastore behaviour in the following scenario. A transaction is started Some changes are made Another, independent, transaction is started using ndb.TransactionOptions.INDEPENDENT propagation…
Slawek Rewaj
  • 809
  • 8
  • 16
0
votes
1 answer

dowload app engine ndb entities via bulk exporter / bulk uploader

Context: My model classes inherit from a base class: class BaseModel(ndb.model): # commom fields and methods class SpecificModel(BaseModel): # specific fields and methods Problem: I want to export the SpecificModel entities using the appengine…
marco alves
  • 1,707
  • 2
  • 18
  • 28
0
votes
1 answer

searching for searchers on appengine

my search problem is the following. My site has job offers, and we have users (searchers) that are interested in getting notified if new offers arrive. The users set some keywords for their jobsearch which change very unfrequently. There are new…
payala
  • 1,357
  • 13
  • 28
0
votes
1 answer

Least costly way to update a ComputedProperty when child models are updated?

I have a data model with parent-child relationships structured as such: Container Metric Value Each of these models has a "status" field, but only the Value model allows input on that field; the other models have a ComputedProperty that…
SteveShaffer
  • 1,577
  • 1
  • 10
  • 14
0
votes
2 answers

AppEngine MapReduce NDB, DeadlineExceededError

we're trying to heavily use MapReduce in our project. Now we have this problem, there is a lots of 'DeadlineExceededError' errors in the log... One example of it ( traceback differs each time a bit ) : Traceback (most recent call last): File…
Lukas Šalkauskas
  • 14,191
  • 20
  • 61
  • 77
0
votes
1 answer

NDB caching temporary / helper properties. Can I turn it off?

It looks like temporary variables are also cached when using NDB. class MyModel(ndb.Model) def __init__(self, *args, **kwds): self._temporary = [] ndb.Model.__init__(self, *args, **kwds) Is there a way not to store the…
rzajac
  • 1,591
  • 2
  • 18
  • 37
0
votes
2 answers

appengine many to many field update value and lookup efficiently

I am using appengine with python 2.7 and webapp2 framework. I am not using ndb.model. I have the following model: class Story(db.Model); name = db.StringProperty() class UserProfile(db.Model): name = db.StringProperty() user =…
whatf
  • 6,378
  • 14
  • 49
  • 78
0
votes
1 answer

NDB Query for repeated structured property by ancestor

I'm testing following object: pk = ndb.Key(League, 'Premier League', 'Season', '2012/13') o = Team( id = 'Chelsea', name ='Chelsea', leagues = [ TeamInLeague( parent = pk, position = 1, …
Neara
  • 3,693
  • 7
  • 29
  • 40
0
votes
1 answer

Combing PolyModel with NDB

I am trying to combine a polymodel class withe an NBD class. Any help in clarifying the "best" way to do this would be great given the following problem. I have a polymodel of fruit (Fruit -> Tree-Bearing -> Apples -> Granny Smith - as an example…
Jon
  • 734
  • 1
  • 7
  • 30
0
votes
1 answer

GAE-NDB: how prevent projection changed the results

I used ndb projection but it did change the results, how the results are not affected by projection? class T(ndb.Model): name = ndb.StringProperty() name2 = ndb.StringProperty(repeated=True) @classmethod def test(cls): for i in…
nguyên
  • 5,156
  • 5
  • 43
  • 45
0
votes
1 answer

Async query throws AssertionError first time (AppEngine, NDB)

When I use fetch_async() on a query it crashes with AssertionError the first time it is run. If I run it again immediately, it's fine. Eg. With model: class User(ndb.Model): user = ndb.UserProperty() name = ndb.StringProperty() …
rhiaro
  • 175
  • 2
  • 11
0
votes
1 answer

Partly update App Engine entity

I'm building a sync engine with App Engine and when I receive data from the client I want to store an object but I don't care if it already exists or not. It works nice today if I always send all properties from the client when updating. But I…
thejaz
  • 2,763
  • 2
  • 26
  • 40
0
votes
2 answers

How to track newly added record to NDB datastore?

I've used the following code before: def add_movie(movie_id, title, picture, description): movie = Movies( id=movie_id, title=title, picture=picture, description=description ) movie.put() but it…
LA_
  • 19,823
  • 58
  • 172
  • 308
0
votes
1 answer

Ancestor Query for immediate parent

I'm attempting to model a recursive structure with App Engine NDB: class Root(ndb.Model): pass class Node(ndb.Model): #Node can have either a Root, or another Node as parent pass root_key = Key(Root, 1) node_a = Key(Root, 1, Node,…
patrickcd
  • 110
  • 8
0
votes
0 answers

How to avoid returning of None values with GAE NDB?

I have complex NDB query like below: employees = Employee.query(query.OR(Employee.passport_id == passport_id, Employee.inn == inn, query.AND(Employee.last_name == last_name, Employee.region == region, Employee.prof_area ==…
LA_
  • 19,823
  • 58
  • 172
  • 308