google-cloud-datastore

Copying data from GAE to local data storage fails

倾然丶 夕夏残阳落幕 提交于 2019-12-01 07:05:56
问题 I have followed all the instructions: 1) I downloaded it like this: appcfg.py download_data -A s~myApp --url=https://myApp.appspot.com/_ah/remote_api/ --filename=data.csv Note that according to this solution I have to append s~ to the app name, or I get the error message: google.appengine.api.datastore_errors.BadRequestError: app s~myApp cannot access app myApp's data 2) I have to add remote_api access to my app.yaml - url: /remote_api script: google.appengine.ext.remote_api.handler

BadFilterError: invalid filter: Only one property per query may have inequality filters (<=, >=, <, >)

[亡魂溺海] 提交于 2019-12-01 06:47:21
问题 I am trying to apply filter on two diffrent properties but it GAE isn't allow me to do this what will be the solution then, there it is the code snipt: if searchParentX : que.filter("parentX >=", searchParentX).filter("parentX <=", unicode(searchParentX) + u"\ufffd") que.order('parentX') if searchParentY : que.filter("parentY >=", searchParentY).filter("parentY <=", unicode(searchParentY) + u"\ufffd") 回答1: The solution would be to do an in memory filtering: You can run two queries (filtering

Google Datastore Composite index issue

╄→гoц情女王★ 提交于 2019-12-01 06:43:41
I am getting below exception : Exception in thread "main" com.google.cloud.datastore.DatastoreException: no matching index found. recommended index is: - kind: cp_outbox properties: - name: format - name: occasion_name - name: sent_datetime - name: status - name: send_date While running below query : SELECT * FROM cp_outbox where send_date <= '2018-03-14' and sent_datetime is null and format='test1' and status=0 and occasion_name='test' So I am using inequality operator in query and I have composite index for that : But still I am getting exception. By looking at error I think the ordering of

Managing users authentication in Google App Engine

本小妞迷上赌 提交于 2019-12-01 06:04:18
I am working on a webapp based on google app engine. The application uses the google authentication apis. Basically every handler extends from this BaseHandler and as first operation of any get/post the checkAuth is executed. class BaseHandler(webapp2.RequestHandler): googleUser = None userId = None def checkAuth(self): user = users.get_current_user() self.googleUser = user; if user: self.userId = user.user_id() userKey=ndb.Key(PROJECTNAME, 'rootParent', 'Utente', self.userId) dbuser = MyUser.query(MyUser.key==userKey).get(keys_only=True) if dbuser: pass else: self.redirect('/') else: self

How to filter rows with null refrences in Google app engine DB

余生长醉 提交于 2019-12-01 05:59:17
问题 I have a Model UnitPattern, which reference another Model UnitPatternSet e.g. class UnitPattern(db.Model): unit_pattern_set = db.ReferenceProperty(UnitPatternSet) in my view I want to display all UnitPatterns having unit_pattern_set refrences as None, but query UnitPattern.all().filter("unit_pattern_set =", None) returns nothing, though I have total 5 UnitPatterns, out of which 2 have 'unit_pattern_set' set and 3 doesn't have e.g. print 'Total',UnitPattern.all().count() print 'ref set'

GAE: AssertionError: No api proxy found for service “datastore_v3”

梦想的初衷 提交于 2019-12-01 05:48:59
问题 I'm writing simple to code to access dev server. Both dev server and datastore emulated have been started locally. from google.appengine.ext import ndb class Account(ndb.Model): name = ndb.StringProperty() acc = Account(name=u"test").put() print(acc) Error: AssertionError: No api proxy found for service "datastore_v3" I tried to set: export DATASTORE_EMULATOR_HOST=localhost:8760 . It does not help. $ dev_appserver.py ./app.yaml WARNING 2017-02-20 06:40:23,130 application_configuration.py:176]

Create entity using datastore viewer Google App Engine

血红的双手。 提交于 2019-12-01 05:46:51
I would like to create an entity in my datastore from the admin console on google app engine. To do this, I read I must clicked on the tab "create" in the datastore viewer BUT I don't have this link. I have just the "query" tab and as I have no data, nothing appears. How can I create an entity from the admin console on google app engine? Dan Holevoet App Engine will only let you create new entities for a Kind that has already been defined. If you haven't ever saved anything to the datastore, your datastore is a blank slate, and you won't be able to query or create in it. If you don't want to

GAE java.lang.IllegalStateException: Must call one of set*BlobStorage() first

风流意气都作罢 提交于 2019-12-01 05:41:58
问题 I am trying to upload a file in GAE using the Blobstore API. I am getting the following exception when running the GAE server locally (dev mode): WARNING: /_ah/upload/ag10cmlwc2NoZWR1bGVychsLEhVfX0Jsb2JVcGxvYWRTZXNzaW9uX18YFQw java.lang.IllegalStateException: Must call one of set*BlobStorage() first. at com.google.appengine.api.blobstore.dev.BlobStorageFactory.getBlobStorage(BlobStorageFactory.java:24) at com.google.appengine.api.blobstore.dev.UploadBlobServlet.init(UploadBlobServlet.java:88)

Export nested BigQuery data to cloud storage

≯℡__Kan透↙ 提交于 2019-12-01 04:55:40
问题 I am trying to export bigquery data to google cloud storage bucket via the API. I adapted a code snippet from here https://cloud.google.com/bigquery/docs/exporting-data Job job = table.extract(format, gcsUrl); // Wait for the job to complete try { Job completedJob = job.waitFor(WaitForOption.checkEvery(1, TimeUnit.SECONDS), WaitForOption.timeout(3, TimeUnit.MINUTES)); if (completedJob != null && completedJob.getStatus().getError() == null) { // Job completed successfully } else { // Handle

Google Datastore Composite index issue

时间秒杀一切 提交于 2019-12-01 04:17:47
问题 I am getting below exception : Exception in thread "main" com.google.cloud.datastore.DatastoreException: no matching index found. recommended index is: - kind: cp_outbox properties: - name: format - name: occasion_name - name: sent_datetime - name: status - name: send_date While running below query : SELECT * FROM cp_outbox where send_date <= '2018-03-14' and sent_datetime is null and format='test1' and status=0 and occasion_name='test' So I am using inequality operator in query and I have