app-engine-ndb Questions
4
Solved
I like the datastore simplicity, scalability and ease of use; and the enhancements found in the new ndb library are fabulous.
As I understand datastore best practices, one should not write code to...
Impish asked 22/2, 2012 at 7:31
2
Solved
From looking for ideas/alternatives to providing a page/item count/navigation of items matching a GAE datastore query, I could find a hint how to backward page navigation with a single cursor by RE...
Particular asked 20/4, 2012 at 4:52
1
I am trying to implement an ndb model audit so that all changes to properties are stored within each model instance. Here is the code of the _pre_put_hook I chose to implement that.
def _pre_put_h...
Ulu asked 22/1, 2014 at 20:2
2
Solved
Suppose I initially create an ndb.Model and wanted to change a field's ndb property type (e.g. IntegerProperty to StringProperty), but wanted to cast the current data stored in that field so that I...
Caston asked 7/11, 2013 at 17:30
2
Solved
So let's say I have a webapp which just lets users save their hobbies. So I have Kind like this:
class Hobby(ndb.Model):
hobby_name = ndb.StringProperty()
Users just create Hobby entities using...
Cristinacristine asked 22/9, 2014 at 17:12
2
I use the following code to get entity based on urlsafe key given:
q_key = ndb.Key(urlsafe=key)
q = q_key.get()
return q
But in case there is no such entity with given urlsafe key, it ret...
Lin asked 22/12, 2013 at 17:10
2
I am trying to get forward and backwards pagination working for a query I have on my app.
I have started with the example at: https://developers.google.com/appengine/docs/python/ndb/queries#cursor...
Result asked 18/12, 2012 at 11:13
1
I've had some data being gathered in production for a couple of days with, lets say, the following model:
class Tags(ndb.Model):
dt_added = ndb.DateTimeProperty(auto_now_add=True)
s_name = ndb.S...
Deadhead asked 8/7, 2014 at 18:43
1
Solved
Trying to model a many-to-many relationship with ndb. Can anyone point to a good example of how to do this?
At here is an example of what I have at the moment:
class Person(ndb.Model):
guilds = ...
Auroraauroral asked 24/6, 2014 at 16:55
3
I want the user to be able to upload images to Google App Engine. I have the following (Python):
class ImageData(ndb.Model):
name = ndb.StringProperty(indexed=False)
image = ndb.BlobProperty()
...
Tokoloshe asked 23/8, 2013 at 0:19
2
Solved
I cant manage to get to 'previous page' in ndb paging.
I have checked the documentation and also this similar question here without success.
def show_feedback(kind, bookmark=None):
"""Renders r...
Dana asked 31/7, 2013 at 15:51
2
Solved
What is a good way to get the number of query result when using NDB on google app engine?
Attempted this:
query = NDB_Model.query(NDB_Model.some_property == some_value)
if len(query) > 0: # &l...
Wineshop asked 31/8, 2012 at 18:18
1
Solved
Is there a builtin or canonical way to consume the first and all successive results for a ndb.get_multi_async call in the order of their completion ?
I would expect, and this illustrates, it along...
Pipage asked 4/4, 2014 at 12:31
2
Solved
The documentation for the IN query operation states that those queries are implemented as a big OR'ed equality query:
qry = Article.query(Article.tags.IN(['python', 'ruby', 'php']))
is equivale...
Baggott asked 13/8, 2012 at 14:8
1
Solved
The following code works as expected and does not trigger the assertion:
@ndb.transactional
@ndb.tasklet
def Foo():
assert ndb.in_transaction()
The following code breaks, triggering the asser...
Altman asked 2/2, 2014 at 2:12
3
Solved
I am in the process of migrating an application from Master/Slave to HRD. I would like to hear some comments from who already went through the migration.
I tried a simple example to just post a n...
Socialist asked 19/11, 2012 at 5:49
2
I'm working on providing an API via GAE that will allow users to page forwards and backwards through a set of entities. I've reviewed the section about cursors on the NDB Queries documentation page...
Vamoose asked 15/1, 2014 at 21:20
2
Solved
I'm creating a Google App Engine application (python) and I'm learning about the general framework. I've been looking at the tutorial and documentation for the NDB datastore, and I'm having some di...
Bioclimatology asked 9/2, 2014 at 5:53
2
Solved
This looks simple, but I just didn't find how to get an entity's id from Google App Engine's ndb.
class Message(ndb.Model):
name: ndb.StringProperty()
...
Create a message object:
message = M...
Endotoxin asked 22/1, 2013 at 12:22
1
Solved
I would like to confirm my understanding of eventual consistency in the Google datastore. Suppose that I have an entity defined as follows (using ndb):
class Record(ndb.Model):
name = ndb.StringP...
Humpbacked asked 9/11, 2013 at 22:47
1
Solved
In AppEngine's NDB datastore, it seems there are 2 ways to relate objects with one another. There's ndb.KeyProperty and parents/ancestors keys. I'm a bit confused as to when I should be using one o...
Rochester asked 6/11, 2013 at 3:3
3
Solved
I am currently offloading a long running job to a TaskQueue to calculate connections between NDB entities in the Datastore.
Basically this queue handles several lists of entity keys that are to b...
Kara asked 23/8, 2012 at 15:35
1
Solved
I have a ndb model class:
class Game(ndb.Model):
gameID = ndb.IntegerProperty()
gameName = ndb.StringProperty()
Is there any way to quickly just delete all entities thats stored in the databas...
Approver asked 22/9, 2013 at 14:53
1
Solved
In profiling my python2.7 App Engine app, I find that it's taking an average of 7ms per record to deserialize records fetched from ndb into python objects. (In pb_to_query_result, pb_to_entity and ...
Championship asked 15/8, 2013 at 18:58
2
Solved
Using ndb, lets say I put_async'd 40 elements, with @ndb.toplevel, wrote an output to user and ended the request, however one of those put_async's resulted in a contention exception, would the resp...
Trifocal asked 1/9, 2012 at 4:32
© 2022 - 2024 — McMap. All rights reserved.