google-app-engine

NDB Query with Computed Property returns a blank list

喜欢而已 提交于 2020-01-07 02:44:09
问题 I'm trying to query an ndb Model with a computed property, but it's returning an empty list. This answer suggests that I should be able to query computed properties and so do the docs. What am I doing wrong? from django.template import defaultfilters class Video(models.SfxModel): title = ndb.StringProperty() slug = ndb.ComputedProperty( lambda self: str(defaultfilters.slugify(self.title)) ) In Interactive Console from app.lib.videos import Video slug = Video.query().get().slug print slug # =>

how to get uploaded file as blobs in servlet using google app engine

会有一股神秘感。 提交于 2020-01-07 02:37:08
问题 I can use the below code to upload a file as blobs, <form action="<%= blobstoreService.createUploadUrl("/upload") %>" method="post" enctype="multipart/form-data"> <input type="file" name="myFile"> <input type="submit" value="Submit"> </form> but in my case am using the Apache Common File Uploader to upload a file. So my form action will be as below, <form action="/upload" method="post" enctype="multipart/form-data"> now in my servlet am getting the file as InputStream. if i want to convert

Google App Engine and Group Provisioning

。_饼干妹妹 提交于 2020-01-07 02:33:07
问题 I really need some help here, I've been at this for almost 2 weeks. What I'm trying to do is use Google's provisioning API inside of GAE (Google App Engine) using oAuth2. I know there are a few of examples using oAuth1 to accomplish this. My understanding though is that oAuth1 is now deprecated and we must used oAuth2, please correct me if I am wrong. I've scoured the internet and the only example I could find to work from is this: http://gdata-samples.googlecode.com/svn-history/r232/trunk

Download code from Google App Engine Java is now possible - Ubuntu

懵懂的女人 提交于 2020-01-07 02:22:09
问题 According to Google's AppEngine Group using the pre-released version 1.5.3 you are able to download you code for Java Applications as well. ./appcfg.sh help download_app AppCfg [options] -A app_id [ -V version ] download_app <out-dir> Download a previously-uploaded app to the specified directory. The app ID is specified by the "-A" option. The optional version is specified by the "-V" option. I tried to run the above command but it is not working. Did anyone manage to download his/her source

de-normalizing data model: django/sql -> app engine

与世无争的帅哥 提交于 2020-01-07 02:21:29
问题 I'm just starting to get my head around non-relational databases, so I'd like to ask some help with converting these traditional SQL/django models into Google App Engine model(s). The example is for event listings, where each event has a category, belongs to a venue, and a venue has a number of photos attached to it. In django, I would model the data like this: class Event(models.Model) title = models.CharField() start = models.DatetimeField() category = models.ForeignKey(Category) venue =

Objectify - many writes to same entity in short period of time with and without transaction

人走茶凉 提交于 2020-01-07 02:03:27
问题 What I'm doing is creating a transaction where 1) An entity A has a counter updated to +1 2) A new entity B is written to the datastore. It looks like this: WrappedBoolean result = ofy().transact(new Work<WrappedBoolean>() { @Override public WrappedBoolean run() { // Increment count of EntityA.numEntityBs by 1 and save it entityA.numEntityBs = entityA.numEntityBs +1; ofy().save().entity(entityA).now(); // Create a new EntityB and save it EntityB entityB = new EntityB(); ofy().save().entity

Objectify - many writes to same entity in short period of time with and without transaction

流过昼夜 提交于 2020-01-07 02:03:07
问题 What I'm doing is creating a transaction where 1) An entity A has a counter updated to +1 2) A new entity B is written to the datastore. It looks like this: WrappedBoolean result = ofy().transact(new Work<WrappedBoolean>() { @Override public WrappedBoolean run() { // Increment count of EntityA.numEntityBs by 1 and save it entityA.numEntityBs = entityA.numEntityBs +1; ofy().save().entity(entityA).now(); // Create a new EntityB and save it EntityB entityB = new EntityB(); ofy().save().entity

What mail service errors can AppEngine produce?

☆樱花仙子☆ 提交于 2020-01-07 01:39:11
问题 I would like to control and embed my send() calls in a try/except, but I'm not sure of what errors it can produce. Looking around the SDK, it seems like MailServiceError is the one, but not sure since I don't know how to test an error like that. Can anyone confirm this? 回答1: Here are the exceptions that can be thrown by a call to send(): https://developers.google.com/appengine/docs/python/mail/exceptions Here's an example of how you could catch these: from google3.apphosting.api import mail #

What mail service errors can AppEngine produce?

跟風遠走 提交于 2020-01-07 01:38:07
问题 I would like to control and embed my send() calls in a try/except, but I'm not sure of what errors it can produce. Looking around the SDK, it seems like MailServiceError is the one, but not sure since I don't know how to test an error like that. Can anyone confirm this? 回答1: Here are the exceptions that can be thrown by a call to send(): https://developers.google.com/appengine/docs/python/mail/exceptions Here's an example of how you could catch these: from google3.apphosting.api import mail #

500 Internal Server Error GAE while trying to send JSON string to client android side?

旧巷老猫 提交于 2020-01-07 01:26:29
问题 I am working on Google App Engine to store data.My application is a android application and I want to receive datas from GAE datastore side.However when I want to receive ArrayList as a JSON text , I am getting "Error : 500 Internal Server Error" message and I could not find any solution about that I put my client and server side codes here ; Server Side @SuppressWarnings("serial") public class ReceiveLoc extends HttpServlet{ public static final String USER_ID = "userId"; public static final