gae-datastore

Best method to determine which of a set of keys exist in the datastore

I have a few hundred keys, all of the same Model, which I have pre-computed: candidate_keys = [db.Key(...), db.Key(...), db.Key(...), ...] Some of these keys refer to actual entities in the datastore, and some do not. I wish to determine which keys do correspond to entities. It is not necessary to know the data within the entities, j...

Query problem in Google app engine.

Hi, I am very new to sql and more over GQL used in Google app engine. I have managed to push my data to the Google servers but I am not able to figure out a way to query from the entities I've loaded to the datastrore. Here's the problem, i want to query only the names and numbers of a user's contacts marked by user id apart from other...

Bulk entity delete in Google App Engine

I'm trying to delete some unwanted data from my datastore with Java and found some code using the DatastoreService that I modified to delete as many entries as possible in 10 seconds: DatastoreService datastore = DatastoreServiceFactory.getDatastoreService(); Query query = new Query("PostalCodes"); long starttime = (new Date()).getTime(...

Problem in importing classes from models file in GAE

Hi, I am very new to python and after a brief intro on to python + Google app engine, I've started to work on a pilot project. I have bulkloaded 2 entities UserDetails and PhoneBook with data onto the app engine. Now in my UI I try to first take in the user name then query it to get the user id from UserDetails, then using the retrieved...

How would you design an AppEngine datastore for a social site like Twitter?

I'm wondering what would be the best way to design a social application where members make activities and follow other member's activities using Google AppEngine. To be more specific lets assume we have these entities: Users who have friends Activities which represent actions made by users (lets say each has a string message and a Ref...

Datastore datetimeproperty iterable?

Hi, I have model class info(db.Model): user = db.UserProperty() last_update_date = db.DateTimeProperty() I need to retrieve last_update_date for specific user. It is working good, i can retrieve this value, i can even pass it to another variable if results: for result in results: data = result.last_up...

App Engine: What is the fastest way to check if my datastore query returns any result?

I like to check if there is any result for my datastore query in the Google App Engine Datastore. This is my query: users = User.all() users.filter("hash =", current_user_hash) What is the fastest and most elegant way to check if my query returns any result? PS: I know a way to do so, but I'm very unsure if it is very efficient... ...

How do I copy local Google App Engine Python datastore to local Google App Engine Java datastore?

I have around 4000 entities that I need to insert into a Java App Engine datastore. As I understand it, only the Python version of App Engine currently has tools to upload data from a CSV file to a datastore. So, what I have done thus far is follow the instructions at http://code.google.com/appengine/docs/python/tools/uploadingdata.htm...

Query/GqlQuery .order() restricting the result set?

I just noticed a strange result from a query that I have trouble understanding. It appears as if adding an order() to a Query is limiting the results I get back. Here is my interaction: >>> SomeModel.all().filter('action =', 'foo').order('created_at').count(), SomeModel.all().filter('action =', 'foo').count() (192L, 293L) >>> Some...

Selecting a given property from a table in App Engine

Is there a way to select only a given property from the App Engine datastore? Imagine I have an User entity with many properties, but in a given moment I just want to fetch a list of user names (instead of fetching all properties for all users). So, something equivalent to the following SQL: SELECT name FROM User; I'm interested in al...

App Engine: Filter for Choosing Entities with a Specific Item Present in their ListProperties

I need to filter entities based on one of their ListProperties having a certain element present. So kind of like: entities.filter('listProp IN ',element) except where listProp and element are reversed if you see what I mean. Anyone know how to filter like this? ...

How do I put a dictionary in the datastore?

Is there a good way to store a Python dictionary in the datastore? I want to do something like the following: from google.appengine.ext import db class Recipe(db.Model): name = db.StringProperty() style = db.StringProperty() yeast = db.StringProperty() hops = db.ListofDictionariesProperty() Of course, that last line doesn't ...

How do I make a temporary backup of the local datastore in the AppEngine SDK for MacOSX

How do I make a temporary backup of the local datastore in the AppEngine SDK for MacOSX And where are the files located? ...

Google app engine datastore reference or not?

hi, i am filling up a big table with text items from different countries. My question is: Should i use a referencePropery to link to languages in another table?. Thats the way i would do it in a normal mysql relational database. or just go redundant and specify the language for each text in the table? Whats better? redundancy & incre...

How do I move data from local appengine datastore to remote datastore?

I can see how to download the remote datastore to local, and how to upload a CSV to the remote app engine server as outlined here: Uploading and Downloading Data But is there a way to export my local data to a CSV that is ready for the remote upload script? Of course I could write a custom exporter, but is there no way to automate this...

Puzzling App Engine Datastore Issue (ListProperty)

Ok so I have the same python code locally and in the gae cloud. when I store an entity locally, the ListProperty field of set element type datetime.datetime looks like so in the Datastore Viewer: 2009-01-01 00:00:00,2010-03-10 00:00:00 when I store same on the cloud, the viewer displays: [datetime.datetime(2009, 1, 1, 0, 0), datetim...

GAE Image Posting to Datastore through Django Form

I'm working on a little side project that involves posting an avatar to a users profile page, seems straight forward enough. I'm following the instructions from the "Using the Images Python API" on the GAE web site. The sample they provide doesn't seem to work with Django though. Searching around here, I found a thread with a similar i...

Datastore entity with kind and key has a null property named

After adding a boolean attribute to an object, fetching that object from the datastore results in the error: Datastore entity with kind <Class> and key <Class:ID> has a null property named <attribute> ...

App Engine - why are there PhoneNumber, Link, Rating etc classes?

I haven't found any reason for the existence of a few of the App Engine classes. There's a PhoneNumber, a Link, a PostalAddress, a GeoPt, a Rating, etc. Why are these given special treatment? They don't seem to have any smarts - e.g. geo searching. I know Link has more space than a String property, but the rest? See: http://code.google....

Why can't I see any data in the Google App Engine *Development* Console?

I run my google app engine application in one of two ways... Directly by using the application from http://localhost:8080 Or execute unit tests from http://localhost:8080/test When I create entities by using the application directly, the data is visible in the Development Console (dataStore view). However, when I execute the unit te...