Error when trying to retrieve a single entity

耗尽温柔 提交于 2020-01-15 09:12:09
问题 I've been playing around with Google Cloud Endpoints for the past few days (aiming to hook it up with AngularJS) and I ran into a bit of trouble when I try to retrieve a single entity from my datastore. My ndb model setup is: class Ingredients(EndpointsModel): ingredient = ndb.StringProperty() class Recipe(EndpointsModel): title = ndb.StringProperty(required=True) description = ndb.StringProperty(required=True) ingredients = ndb.StructuredProperty(Ingredients, repeated=True) instructions =

Dynamically created method and decorator, got error 'functools.partial' object has no attribute '__module__'

∥☆過路亽.° 提交于 2019-12-30 02:44:12
问题 I am currently using EndpointsModel to create a RESTful API for all my models on AppEngine. Since it is RESTful, these api have a lot of repeat code which I want to avoid. For example: class Reducer(EndpointsModel): name = ndb.StringProperty(indexed=False) @endpoints.api( name="bigdata", version="v1", description="""The BigData API""", allowed_client_ids=ALLOWED_CLIENT_IDS, ) class BigDataApi(remote.Service): @Reducer.method( path="reducer", http_method="POST", name="reducer.insert", user

How to “POST” ndb.StructuredProperty?

北慕城南 提交于 2019-12-23 04:29:56
问题 Problem: I have following EndpointsModels , class Role(EndpointsModel): label = ndb.StringProperty() level = ndb.IntegerProperty() class Application(EndpointsModel): created = ndb.DateTimeProperty(auto_now_add=True) name = ndb.StringProperty() roles = ndb.StructuredProperty(Role, repeated=True) and an API method: class ApplicationApi(protorpc.remote.Service): @Application.method(http_method="POST", request_fields=('name', 'roles'), name="create", path="applications") def ApplicationAdd(self,

Post an ndb StructuredProperty _Message__decoded_fields

可紊 提交于 2019-12-20 04:23:29
问题 My Problem: I am attempting to fill a datastore model in GAE that contains an ndb.Structured Property() using a 'POST' request. This question has been asked recently but not answered (How to “POST” ndb.StructuredProperty?) I have the following two models: class Check(EndpointsModel): this = ndb.StringProperty() that = ndb.StringProperty() class CheckMessage(EndpointsModel): check = ndb.StructuredProperty(Check) I'm trying to post this data: { check: { "this":"test", "that":"test" } } with the

Endpoints Proto Datastore - Inequality filter on query_method

送分小仙女□ 提交于 2019-12-12 00:17:29
问题 When using the endpoints-proto-datastore query_method on an EndpointsModel, is it possible to have an inequality filter passed as a query field? For instance, say I have a model with a lastmodified field, and I want to query for all the records that have a lastmodified > date , where date is a value passed to the API by the client. class MyModel(EndpointsModel): attr1 = ndb.StringProperty() lastmodified = ndb.DateTimeProperty() From the documentation I have seen, it seems like the query

Upload image to Appengine Datastore using BlobStore and Endpoints

我只是一个虾纸丫 提交于 2019-12-11 16:10:34
问题 How can I upload a file/image to the Appengine Datastore using blobStore? I'm using Google Cloud Endpoints. This is my model: class ProductImage(EndpointsModel): _message_fields_schema = ('product', 'enable', 'image') product = ndb.KeyProperty(Product) image = ndb.BlobKeyProperty(required=True) enable = ndb.BooleanProperty(default=True) How can I test it from API Explorer? At the frontend I'm using AngularJS. 回答1: I couldn't figure out a way to do this with just Endpoints; I had to have a

Does Google App Engine's git Push-to-Deploy also work with git submodules?

拈花ヽ惹草 提交于 2019-12-11 10:26:48
问题 I've got an appengine Python app which takes advantage of endpoints-proto-datastore. I did install endpoints-proto-datastore using: git submodule add https://github.com/GoogleCloudPlatform/endpoints-proto-datastore It does work when I deploy my app through PyCharm (using Google Appengine Python SDK). It does not work when I push to google's repository (Push-to-Deploy). When using Push-to-Deploy I get the following log message: ImportError: No module named endpoints_proto_datastore.ndb Do I

Setting parent key but not child key while using endpoint-proto-datastore

一世执手 提交于 2019-12-10 20:21:05
问题 How can I set a parent/ancestor for an EndpointsModel and have the entity ID/Key generated automatically by datastore? I've tried to adapt the keys_with_ancestors sample but seem to be hitting a bit of a block because it requires both id and parent to be specified. I'd like to do something similar except provide only parent id or key and have entity id/key auto-generated by the app engine datastore. This following shows how I would do it using just NDB. class Parent(ndb.Model): name = ndb

Local testing for Android App using Cloud Endpoints for Google App Engine

只谈情不闲聊 提交于 2019-12-09 06:32:04
问题 I am developing an Android app that uses Google Cloud Endpoints on Google App Engine (in Python) for its backend. The Android app authorizes the user using Google Play Services on the Android device, and it all works fantastically. However, now that I have actual users, I'd like to be able to test this all locally before deploying any app engine API changes to production, and I haven't figured out how to have the Android app talk to my local development server anywhere. The testing

What is the best way to auth, identify and store delicate information about users?

巧了我就是萌 提交于 2019-12-08 13:39:34
With the purpose of learning about endpoints I'm building an app called "Where Are You?". The app lets users request the location of other users. The idea is that it does so by letting the user select a contact, lookup the contact by phone number in my endpoint. If found it means that the contact have the app and GCM is sent requesting the location. If the contact isn't found a SMS is sent with an url which will request the location through a browser, perform a http post of said location and have the server GCM it back to the person requesting the location. I need to authenticate users of the