google-cloud-datastore

How to create autocomplete with GAE?

五迷三道 提交于 2019-12-01 22:38:39
问题 I use jQuery UI autocomplete widget. Also I have GAE datastore: class Person(db.Model): # key_name contains person id in format 'lastname-firstname-middlename-counter', # counter and leading dash are omitted, if counter=0 first_name = db.StringProperty() last_name = db.StringProperty() middle_name = db.StringProperty() How can I search the person in the autocomplete widget, when user can input there surname, first name and/or middle name? So, I am getting user input string as self.request.get

How to create autocomplete with GAE?

拟墨画扇 提交于 2019-12-01 22:30:48
I use jQuery UI autocomplete widget . Also I have GAE datastore: class Person(db.Model): # key_name contains person id in format 'lastname-firstname-middlename-counter', # counter and leading dash are omitted, if counter=0 first_name = db.StringProperty() last_name = db.StringProperty() middle_name = db.StringProperty() How can I search the person in the autocomplete widget, when user can input there surname, first name and/or middle name? So, I am getting user input string as self.request.get('term') . How should I search for the same in my datastore (since I need to look at each field and

Communication with Datastore and cloud Storage from google Compute engine in Java

£可爱£侵袭症+ 提交于 2019-12-01 22:21:49
I've GAE application which creates some data in the Google Cloud Datastore and stores some binary files into the Google Cloud Storage - let's call the application WebApp . Now I have a different application running on the Google Cloud Storage Google compute engine. Let's call the application ComputeApp . Now, the ComputeApp should connect to the Datastore, query for entities created by the WebApp and read related binary file from the Google Cloud Storage. Then the CoumputeApp does some processing over the binary file such is reencoding to different format and store it back to the Cloud Storage

Manage nested list of entities within entities in Google Cloud Datastore

江枫思渺然 提交于 2019-12-01 21:54:25
I am new to Datastore and I am trying to create a simple app that tracks books borrowing. I would like the DB schema to be as follows: books: book_id name: borrowing: timestamp: user_id firstname email users: name: borrowed: timestamp: book_id I am using the console to configure the DB. I have defined two Kinds: Books and User Business logic: 1 book can be borrowed by n users. 1 user can borrow n books Basically, when a user borrows a book I want the two following inserts to occur: a new borrowing entry is appended to the book entity of type Book, with the current timestamp as key and user_id,

Not authorized to use Google Cloud Datastore for this project

淺唱寂寞╮ 提交于 2019-12-01 21:28:58
问题 As of today I'm unable to Query my own Datastore from the new App Engine Admin console. I'm stopped by an Datastore Error "You are not authorized to use Google Cloud Datastore for this project." I'm the owner of the project and I've tried on other "owner" accounts but I get the same error. It was working fine last week. 回答1: I had the same problem (reported and fixed) few months ago, I guess it came back with the last admin console update last week. It is not a decent workaround but if you

Using Google Cloud Datastore with NDB API?

老子叫甜甜 提交于 2019-12-01 21:14:07
问题 There is a lot of info on using NDB API with Google App Engine Datastore but I can't find any info on how to use NDB with Google Cloud Datastore. The only module I found is googledatastore which is very primitive library. How is App Engine Datastore different from the Cloud Datastore? Is NDB available for the Cloud Datastore? 回答1: NDB support outside of App Engine (using Google Cloud Datastore) is currently in development. UPDATE: Check out the NDB development discussion on GitHub. 回答2: You

In Google App Engine, how to check input validity of Key created by urlsafe?

老子叫甜甜 提交于 2019-12-01 21:03:21
Suppose I create a key from user input websafe url key = ndb.Key(urlsafe=some_user_input) How can I check if the some_user_input is valid? My current experiment shows that statement above will throw ProtocolBufferDecodeError (Unable to merge from string.) exception if the some_user_input is invalid, but could not find anything about this from the API. Could someone kindly confirm this, and point me some better way for user input validity checking instead of catching the exception? Thanks a lot! If you try to construct a Key with an invalid urlsafe parameter key = ndb.Key(urlsafe='bogus123')

Autoincrement ID in App Engine datastore

廉价感情. 提交于 2019-12-01 20:55:23
I'm using App Engine datastore, and would like to make sure that row IDs behave similarly to "auto-increment" fields in mySQL DB. Tried several generation strategies, but can't seem to take control over what happens: the IDs are not consecutive, there seem to be several "streams" growing in parallel. the ids get "recycled" after old rows are deleted Is such a thing at all possible ? I really would like to refrain from keeping (indexed) timestamps for each row. Chris Calo It sounds like you can't rely on IDs being sequential without a fair amount of extra work. However, there is an easy way to

Can I use SQLite libraries on google app engine?

最后都变了- 提交于 2019-12-01 20:36:16
I'm currently using Google Datastore for storing data. I want to keep an offline version in the form of sql database. Is it possible to use sqlite on google app engine to convert datastore into sql database? No, it is not possible to use sqlite on AppEngine. Currently there is no option to convert data from the AppEngine datastore to a SQL database. dolphin You can do this locally since Python Development Server v1.7.6 (link outdated) https://developers.google.com/appengine/docs/python/tools/old_devserver#Using_the_Datastore SQLite is now used as the backend for your local Datastore stub.

Google Datastore cross region replication

风格不统一 提交于 2019-12-01 19:42:29
We have a app that is hosted in US and the EU. For great performance we will host a datastore instance on both locations. Now is our question how we can replicate the data from the US datastore to the EU datastore? Or is it no matter where we store the data from technical view? Dan Cornilescu There is not such thing as multi-location GAE apps (at least not yet). The app's unique location can be selected when the app is created and cannot be changed. See App Engine - How to create project in region us-central and gae app moving to eu-datacenter or re-opening An important note from Creating a