google-app-engine

Is there a way to do aggregate functions on Google App Engine?

旧街凉风 提交于 2020-01-09 07:55:06
问题 One of the nice things relational databases support are the aggregate functions like count, sum, avg etc. But it seems that if you are using GAE, when inserting or updating a record you must calculate and store the count, sum, avg, etc. values of the whole table. But what if you have many conditional groupings? Given a Person: class Person { @Id Integer age; String city; } If I want the total number of persons and the average age Is it correct that everytime I create, update or delete a

java.lang.IllegalStateException: Could not load JDBC driver class [com.mysql.jdbc.GoogleDriver]

旧巷老猫 提交于 2020-01-09 03:53:06
问题 I am trying to connect to my database from the Google Flexible Environment to the Google Cloud SQL . The connection string and the driver class are shown below: <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="com.mysql.jdbc.GoogleDriver" /> <property name="url" value="jdbc:google:mysql://mz-test:us-central1:mz-life-cloudsql-prod/mz_db" /> <property name="username" value="root" /> <property name="password" value

How can I parse JSON in Google App Engine?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-08 19:08:16
问题 I'd like to parse a JSON string into an object under Google App Engine (python). What do you recommend? Something to encode/stringify would be nice too. Is what you recommend built in, or a library that I have to include in my app? Is it secure? Thanks. 回答1: Consider using Django's json lib, which is included with GAE. from django.utils import simplejson as json # load the object from a string obj = json.loads( string ) The link above has examples of Django's serializer, and here's the link

How can I parse JSON in Google App Engine?

杀马特。学长 韩版系。学妹 提交于 2020-01-08 19:05:56
问题 I'd like to parse a JSON string into an object under Google App Engine (python). What do you recommend? Something to encode/stringify would be nice too. Is what you recommend built in, or a library that I have to include in my app? Is it secure? Thanks. 回答1: Consider using Django's json lib, which is included with GAE. from django.utils import simplejson as json # load the object from a string obj = json.loads( string ) The link above has examples of Django's serializer, and here's the link

Spring - Redirect after POST (even with validation errors)

五迷三道 提交于 2020-01-08 13:53:14
问题 I'm trying to figure out how to "preserve" the BindingResult so it can be used in a subsequent GET via the Spring <form:errors> tag. The reason I want to do this is because of Google App Engine's SSL limitations. I have a form which is displayed via HTTP and the post is to an HTTPS URL. If I only forward rather than redirect then the user would see the https://whatever.appspot.com/my/form URL. I'm trying to avoid this. Any ideas how to approach this? Below is what I'd like to do, but I only

How do you validate a URL with a regular expression in Python?

浪子不回头ぞ 提交于 2020-01-08 09:53:47
问题 I'm building an app on Google App Engine. I'm incredibly new to Python and have been beating my head against the following problem for the past 3 days. I have a class to represent an RSS Feed and in this class I have a method called setUrl. Input to this method is a URL. I'm trying to use the re python module to validate off of the RFC 3986 Reg-ex (http://www.ietf.org/rfc/rfc3986.txt) Below is a snipped which should work? p = re.compile('^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*)

How to redirect *.appspot.com to custom domain

只愿长相守 提交于 2020-01-07 09:05:47
问题 How do you redirect your *.appspot.com domain to your custom domain. What I want is redirect the domains like this: app-id.appspot.com -> mycustomdomain.com www.mycustomdomain.com -> mycustomdomain.com Note: I am using go and gorilla mux. 回答1: You can do http.Handler combinatorics as described here to reuse code. In your case the combinator would look something like this (tweak it to your taste and requirements): func NewCanonicalDomainHandler(next http.HandlerFunc) http.HandlerFunc { return

Is it possible to customize fusion table( should point my database ) to use fusionTableLayer?

一个人想着一个人 提交于 2020-01-07 08:33:23
问题 I would like to create a Map by the excel sheet values (.csv files too). By using FusionTableLayer API, I think it is possible. At first step we could upload the excel values to the database. Then we create a map by the database annotated value. It is very good idea. This is what I wanted. But One thing is problem to me with FusionTableLayer API is google's Drive has been pointed for the fusion table. It means that all my business data will be shared with google. I don't want to be like that.

GWT GAE app engine modules using appengine-skeleton-archetype

落爺英雄遲暮 提交于 2020-01-07 06:31:07
问题 I tried to create a new maven project using com.google.appengine.archetypes:appengine-skeleton-archetype and it generate appname, appname-ear, appname-war. Based on what I read to convert backends to module, I need to have at least default module. How do I change appname-war to default or add a new module name default, because every time I did that, the default module doesn't seems to be appeared on the outside of appname project (the parent project). Thanks. 回答1: I think I got the answer. I

Why does the Google App Engine warn me 'file referenced by handler not found : dailybasic.py' again and again?

家住魔仙堡 提交于 2020-01-07 06:28:31
问题 I'm coding with the GAE in python, and I tried to make two script files. So I make the app.yaml like this: application: mathgirlna version: 1 runtime: python api_version: 1 handlers: - url: /static static_dir: static - url: /dailybasic/.* script: /dailybasic.py login: admin - url: /.* script: main.py And when I see the logs, it says 'file referenced by handler not found : dailybasic.py'. I have no idea how the app.yaml have to be written. Here's my file tree: static index.css app.yaml index