gae-datastore

Google App Engine-Ajax refresh from datastore using python

Hi, I have an application(developed in python) that requires a refreshed view from the datastore after every 5 seconds. I have came out with an javascript function and handle the refresh using ajax. Ajax function <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"&gt;&lt;/script&gt; ...

Efficiently retrieving entities that match any element of a set of ids

I'm writing software to provide feedback to people across many categories. For example, I might have 30 employees and 40 standards of evaluation (e.g. "arrives on time," "is polite," "appears to brush his teeth," etc). At arbitrary times, the supervisor can submit a piece of feedback like "employee 3 gets a 5/5 for standard 8 (he smell...

Establishing entity groups while maintaining access to Long ids

I'm using the appengine datastore, and all of my entities have Long ids as their PrimaryKey. I use those ids to communicate with the client, since the full-fledged Keys take much more bandwidth to transmit. Now, I want to form entity groups so that I can do complex operations within transactions, and it seems from http://code.google.co...

Rounding a value in JDOQL

I've got data in the GAE data store. I want to write a JDOQL against that data that takes one of the columns and rounds the value of it. Can I do this? ...

GWT RPC and persistent Java objects

First of all, many thanks to Craig for the excellent answer below which I found very useful when searching my original issue... ref: http://stackoverflow.com/questions/2237142/gwt-simple-rpc-use-case-problem-code-included Building on this solution, how does one overcome the (seemingly GWT limitation) where if i leave my persistable obj...

Is appengine Python datastore query much (>3x) slower than Java?

I've been investigating the appengine to see if I can use it for a project and while trying to choose between Python and Java, I ran into a surprising difference in datastore query performance: medium to large datastore queries are more than 3 times slower in Python than in Java. My question is: is this performance difference for datast...

Alternative strategy to query aggregation ("group by") in google app engine datastore

App Engine Datastore cannot be queried for an aggregate result. Example: I have an entity called "Post" with the following fields: Key id, String nickname, String postText, int score I have many different nicknames and many posts by each nickname in my datastore. If I want a leader board of the top ten nicknames of total scores, I w...

Clarification: can I put all of a user's data in a single entity group by making up an ancestor key?

I want to do several operations on a user's data in a single transaction, but won't need to update multiple users' data in a single transaction. I see from http://code.google.com/appengine/docs/python/datastore/keysandentitygroups.html#Entity_Groups_Ancestors_and_Paths that "A good rule of thumb for entity groups is that [entity groups]...

Getting implicit property names on a db.Model in Google App Engine?

How can I get access to the implicit property names of a db.Model in Google App Engine? In particular, assume I have the following: class Foo(db.Model): specific = db.IntegerProperty() class Bar(db.Model): foo = db.ReferenceProperty(Foo, collection_name = "bars") if I attempt to get the property names on Foo, like so: my_foo = ...

How to make a light query for a many to many relationship in Google Apps Engine?

How to make a light query for a many to many relationship? Users has many Lists the ListUser is the model that links them Currently I'm doing like this but there are a lot of get queries to get all this data. lists = [] for list in user.lists: lists.append(list.list) Now I got this: list_users = user.lists.fetch(1000) # proble...

Java Generic Object Passing

Hello Everybody! I'm playing around on GAE (I'm using Objectify) and wanted to make something like a generic method, but aint sure how to do it (and as far as my understandig goes, generics wouldn't be a solution for me). This is my setup: public abstract class Cloud{ Key<Cloud> parent; public Cloud(Key<Cloud> parent,...){ ...

App Engine reference property optimization

I have a database structure like this - class Movie(db.Model): name = db.StringProperty() class Tag(db.Model): name = db.StringProperty() class MovieTag(db.Model): movie = db.ReferenceProperty(Movie, collection_name='tags') tag = db.ReferenceProperty(Tag, collection_name='movies') I have a query where I am trying to ...

Using the 'INTO' keyword in JDOQL with GAE

I have a persistent class, 'Meeting' that has a 'minute' and 'hour' field among others. I only need these two fields to populate a dropdown in my ui. The example I found tells me that I can create a simple bean that would house just these two fields but I'm getting an error saying that it can't convert an Integer to a MyTime object. It's...

Should I never rely on the datastore index to contain my data (indexed)?

In the book Programming Google AppEngine, page 181, it says: In rare cases, it’s also possible for changes to indexes to be applied prior to changes to entities, and for the apply phase to fail and leave committed changes unapplied until the next transaction on the entity group. How can I deal with these cases? Does my put operation ...

[Google app engine] I have my model structure like this: ROOT/models/*.py files for each model

But I have a problem importing models in each other. EX: model1 imports: model2, model3, model4 model2 imports: model1, model3, model4 model3 imports: model1, model2, model4 model4 imports: model1, model2, model3 But this gives me errors, saying it can't import :S Error like this: File "C:\GAE\google\appengine\tools\dev_appserver....

Best way to pull GAE Datastore data as a list

I'm looking for the best way to pull info from the datastore into a list (with the intention of outputting to ReportLab to generate a pdf). Is there a way to do it besides looping through the output, and creating a list from it? ...

How to generate large files (PDF and CSV) using AppEngine and Datastore?

When I first started developing this project, there was no requirement for generating large files, however it is now a deliverable. Long story short, GAE just doesn't play nice with any large scale data manipulation or content generation. The lack of file storage aside, even something as simple as generating a pdf with ReportLab with 1...

How can I query for records based on an attribute of a ReferenceProperty? (Django on App Engine)

If I have the following models in a Python (+ Django) App Engine app: class Album(db.Model): private = db.BooleanProperty() ... class Photo(db.Model): album = db.ReferenceProperty(Album) title = db.StringProperty() ...how can I retrieve all Photos that belong to a public Album (that is, an Album with private == False)? To fu...

GAE Query fetch()

I am trying to learn simple operations with the datastore and I am having problems. Can someone help why this is not working? class Pet(db.Model): name = db.StringProperty pet = Pet(name="Fluffy") pet.put() query = Pet.all() results = query.fetch(limit=5) print pet.name When I run this I get <class 'google.appengine.ext.db.St...

Getting the "Closest" Value out of the Datastore

What is the recommended (read most efficient) way to obtain a single entity out of the datastore based on a value that's closest to one provided. For example, I have the following DataModel: class MyObject(db.Model): someValue = db.IntegerProperty() shortDescription = db.TextProperty() During a GET a value is passed in, I wou...