google-cloud-datastore

How do I get the value of a StringProperty in Python for Google App Engine?

喜你入骨 提交于 2019-12-25 04:43:11
问题 How do I get the values of a nbd.Model? I want to return a description that is composed of several of the fields but I can't get it to work. This is my code for my class: class User(ndb.Model): name = ndb.StringProperty() email = ndb.StringProperty() @classmethod def get_description(self): # return "Kobe Bryant (kobe.bryant@lakers.net)" return self.name + ' (' + self.email + ')' But name is a StringProperty object and can't be appended to a string. How do I get the value of the StringProperty

How do I get the value of a StringProperty in Python for Google App Engine?

怎甘沉沦 提交于 2019-12-25 04:43:02
问题 How do I get the values of a nbd.Model? I want to return a description that is composed of several of the fields but I can't get it to work. This is my code for my class: class User(ndb.Model): name = ndb.StringProperty() email = ndb.StringProperty() @classmethod def get_description(self): # return "Kobe Bryant (kobe.bryant@lakers.net)" return self.name + ' (' + self.email + ')' But name is a StringProperty object and can't be appended to a string. How do I get the value of the StringProperty

Google App Engine - Multiple child/parent

≯℡__Kan透↙ 提交于 2019-12-25 04:15:38
问题 I want to make friend system that have db model like this: class Users(ndb.Model): username = ndb.StringProperty(required = True) bio = ndb.StringProperty() class friend_list(ndb.Model): list = ndb.StringProperty(repeated=True) class friend_pending(ndb.Model): list = ndb.StringProperty(repeated=True) friend_pending is model for friend that not yet accepted. While friend_list is model for friend that are accepted. I want to make both friend_list and friend_pending to be child of Users entity.

google datastore Insert Date as null value using java

烂漫一生 提交于 2019-12-25 04:06:15
问题 package com.example.guestbook; import com.google.appengine.api.datastore.DatastoreService; import com.google.appengine.api.datastore.DatastoreServiceFactory; import com.google.appengine.api.datastore.Entity; import java.io.IOException; import java.util.Date; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; Key addTask(String description, DateTime receiveddate) { Key key = datastore.allocateId(keyFactory.newKey(

Google Datastore returning “503 Backend Error”

让人想犯罪 __ 提交于 2019-12-25 03:59:17
问题 I'm sending the following request to the Google Datastore API, via the PHP client, and i'm getting a "503 Backend Error" without any other information. I tried the online client available here, but the error is the same. Maybe something is malformed on my request? The documentation wasn't very helpful: { "mode": "NON_TRANSACTIONAL", "mutation": { "upsert": [ { "key": { "path": [ { "kind": "Log" } ] }, "properties": { "event": { "indexed": false, "stringValue": "new_order" }, "dataType": {

difference between DateProperty and DateTimeProperty

醉酒当歌 提交于 2019-12-25 03:47:13
问题 In layman's term, what's the difference between ndb.DateProperty and ndb.DateTimeProperty ? When would I use which? For example, my intent is to use either with the param auto_now_add=True . 回答1: From the docs: These take values belonging to the corresponding classes (date, time, datetime) of the standard Python datetime module. The most general of the three is DateTimeProperty, which denotes both a calendar date and a time of day; the others are occasionally useful for special purposes

error on spring data jpa with gae

孤街浪徒 提交于 2019-12-25 03:44:06
问题 I use Google App Engine and Spring Data JPA. @Entity public class Feed { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Key id; private String name; private String url; private Date created; public Feed() { } public Feed(String name, String url) { this.name = name; this.url = url; this.created = new Date(); } // Getter and Setter } @Entity public class News { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Key id; @ManyToOne private Feed feed; private String

GAE, Local datastore does not create

时光毁灭记忆、已成空白 提交于 2019-12-25 02:56:12
问题 I have no idea in what extend GAE is not easy to understand :( My servlet manipulate a json string and then I'm trying to store it in datastore. When I run the application I'm getting this output: Jan 27, 2014 6:59:04 PM com.google.appengine.api.datastore.dev.LocalDatastoreService load INFO: The backing store, D:\Android\IntelliJ IDEA\workspace\EyeBall\AppEngine\out\artifacts\AppEngine_war_exploded\WEB-INF\appengine-generated\local_db.bin, does not exist. It will be created. 1 2 3 4 5 7 *** *

Google datastore.lookup in Node.js returns no results

*爱你&永不变心* 提交于 2019-12-25 02:51:10
问题 I'm trying to run a simple lookup against my Google datastore data via the google-api-nodejs-client JS plugin. When I run this lookup using Google's "try it now" tool, it works fine: Request POST https://www.googleapis.com/datastore/v1beta2/datasets/healthier-staging/lookup?key={YOUR_API_KEY} { "keys": [ { "path": [ { "kind": "Subscriber", "name": "+1215XXXXXXX" } ] } ] } Response 200 OK { "found": [ { "entity": { "key": { "partitionId": { "datasetId": "s~healthier-staging" }, "path": [ {

Google datastore.lookup in Node.js returns no results

旧巷老猫 提交于 2019-12-25 02:51:00
问题 I'm trying to run a simple lookup against my Google datastore data via the google-api-nodejs-client JS plugin. When I run this lookup using Google's "try it now" tool, it works fine: Request POST https://www.googleapis.com/datastore/v1beta2/datasets/healthier-staging/lookup?key={YOUR_API_KEY} { "keys": [ { "path": [ { "kind": "Subscriber", "name": "+1215XXXXXXX" } ] } ] } Response 200 OK { "found": [ { "entity": { "key": { "partitionId": { "datasetId": "s~healthier-staging" }, "path": [ {