google-app-engine

Python: DISTINCT on GQuery result set (GQL, GAE)

Imagine you got an entity in the Google App Engine datastore, storing links for anonymous users. You would like to perform the following SQL query, which is not supported: SELECT DISTINCT user_hash FROM links Instead you could use: user = db.GqlQuery("SELECT user_hash FROM links") How to use Python most efficiently to filter the r...

Possible to integrate Google AppEngine and Google Code for continuous integration?

Anyone have any thoughts on how/if it is possible to integrate Google Code commits to cause a Google AppEngine deployment of the most recent code? I have a simple Google AppEngine project's source hosted on Google Code and would love if everytime I committed to Subversion, that AppEngine would reflect the latest commit. I don't mind if...

Upgrading Google Application Engine program to use unicode

I have a simple Google App Engine app, that I wrote using ordinary strings. I realize I want to make it handle unicode. Are there any gotchas with this? I'm thinking of all the strings that I currently already have in the live database. (From real users who I don't want to upset.) ...

How can I optimize this Google App Engine code?

I'm relatively new to the python world, but this seems very straight forward. Google is yelling at me that this code needs to be optimized: class AddLinks(webapp.RequestHandler): def post(self): # Hash the textarea input to generate pseudo-unique value hash = md5.new(self.request.get('links')).hexdigest() ...

How to override HTTP request verb in GAE

In the context of a Google App Engine Webapp framework application: I want to changed the request verb of a request in the case a parameter _method is provided, for example if a POST request comes in with a parameter _method=PUT, I need to change the request to call the put method of the handler. This is to cope with the way prototype.j...

Credit card payments and notifications on the Google App Engine

I ported gchecky to the google app engine. you can try it here It implements both level 1 (cart submission) and level 2 (notifications from google checkout). Is there any other payment option that works on the google app engine (paypal for example) and supports level 2 (notifications)? ...

Google AppEngine: How to fetch more than 1000?

First: I'm a beginner in python. How can I fetch more than 1000 record from data store and put all in one single list to pass to django? ...

Python: Check if uploaded file is jpg

How can I check if a file uploaded by a user is a real jpg file in Python (Google App Engine)? This is how far I got by now: Script receives image via HTML Form Post and is processed by the following code ... incomming_image = self.request.get("img") image = db.Blob(incomming_image) ... I found mimetypes.guess_type, but it does not ...

Name of a file in a POST request in Google AppEngine

Given the html form ... <form id="mainform" action="/upload" enctype="multipart/form-data" method="post"> <div> <input type="file" name="img"/> </div> <div> <input type="submit" value="Send"> </div> </form> ... and the handler ... class Picture(db.Model): image = db.Blob...

import mechanize module to python script

I tried to import mechanize module to my python script like this, from mechanize import Browser But, Google appengine throws HTTP 500 when accessing my script. To make things more clear, Let me give you the snapshot of my package structure, root ....mechanize(where all the mechanize related files there) ....main.py ....app.yaml ....

Google AppEngine App Version

Is it possible to fetch the current application version programmatically for use in urls with far future expires header? For example: <link rel="stylesheet" href="app.js?v=1.23" /> Should be automatically updated to: <link rel="stylesheet" href="app.js?v=1.24" /> In order to do so I need to get the version. ...

Why does Google App Engine restrict GQL queries?

I was reading about App Engine on wikipedia and came across some GQL restrictions: JOIN is not supported can SELECT from at most one table at a time can put at most 1 column in the WHERE clause What are the advantages of these restrictions? Are these restrictions common in other places where scalability is a priority? ...

Optimization of Google App Engine Code

Google app engine tells me to optimize this code. Anybody any ideas what I could do? def index(request): user = users.get_current_user() return base.views.render('XXX.html', dict(profiles=Profile.gql("").fetch(limit=100), user=user)) And later in the template I do: {% for profile in profiles %} <a href="/p...

DJANGO Template Variables and Javascript

Hello, When i render a page using the Django template renderer, i can pass in a dictionary variable containing various values so i can manipulate them in the page using {{ myVar }}. Is there a way to access the same variable in Javascript (perhaps using the DOM, i don't know how Django makes the variables accessible), i want to be able...

Data Modelling Advice for Blog Tagging system on Google App Engine

Am wondering if anyone might provide some conceptual advice on an efficient way to build a data model to accomplish the simple system described below. Am somewhat new to thinking in a non-relational manner and want to try avoiding any obvious pitfalls. It's my understanding that a basic principal is that "storage is cheap, don't worry ...

Any DAL/ORM on GAE?

Is there any Database Abstraction Layer (DAL) or Object Relational Mapper (ORM) that works on Google App Engine (GAE), and on normal relational databases (RDBS), other than web2py's? If not, is anybody working on porting one of the existing DAL/ORM to GAE? ...

How to dynamically generate a pdf from Google's appengine?

I'd like to create an application that would run on Google's appengine. However, this application needs to be able to generate PDFs dynamically. How could I do this? ...

GQL query to effectively span entity relationships

I'm in a situation where I need to span Google App Engine entity relationships in a query like in the Django database model. I'm using ListPropertys for one-to-many relationships, like so: class Foo(db.Model): bars = db.ListProperty(db.Key) class Bar(db.Model): eggs = db.ListProperty(db.Key) And I'd like to perform a query that does t...

How to write a Web Service for Google App Engine?

Hello all, I am simply wondering how to write a Web Service (XML - SOAP) for Google App Engine? I am really new with Python and I have been looking for example for a while, but no chance. Does anybody could point me out any article or simply could give me an example of a Web Service in Python with Google App Engine? Thanks! ...

using "onclick" with radio button in appengine.

Here's a code snippet. . . <form name="FinalAccept" method="get"><br> <input type="radio" name="YesNo" value="Yes" onclick="/accept"> Yes<br> <input type="radio" name="YesNo" value="No" onclick="/accept"> No<br> Clearly, what I'm trying to do is call the routine linked to /accept when the user clicks on the radio button. I know the...