gae-datastore

How to think in data stores instead of databases?

As an example, Google App Engine uses data stores, not a database, to store data. Does anybody have any tips for using data stores instead of databases? It seems I've trained my mind to think 100% in object relationships that map directly to table structures, and now it's hard to see anything differently. I can understand some of the ...

What database does Google use?

Is it Oracle or MySQL or something they have built themselves? ...

GAE - How to live with no joins?

Example Problem: Entities: User contains name and a list of friends (User references) Blog Post contains title, content, date and Writer (User) Requirement: I want a page that displays the title and a link to the blog of the last 10 posts by a user's friend. I would also like the ability to keep paging back through older entries. ...

Dynamically choose which properties to write to Appengine Datastore

Has anyone tried to dynamically select which properties they want to write to an entity on appengine? For example: I have a web form with 5 fields, and any given user will fill out some subset of those fields. I POST only the fields with data to the server (e.g. Fields 1,2,4). On the server side, how do I elegantly write only properties...

What is a good pattern for inexact queries in the Google App Engine Datastore?

The Google App Engine Datastore querying language (gql) does not offer inexact operators like "LIKE" or even case insensitivity. One can get around the case sensitive issue by storing a lower-case version of a field. But what if I want to search for a person but I'm not sure of the spelling of the name? Is there an accepted pattern fo...

AppEngine: Maintaining DataStore Consistency When Creating Records

I've hit a small dilemma! I have a handler called vote; when it is invoked it sets a user's vote to whatever they have picked. To remember what options they previously picked, I store a VoteRecord options which details what their current vote is set to. Of course, the first time they vote, I have to create the object and store it. But s...

AppEngine: Query datastore for records with <missing> value

I created a new property for my db model in the Google App Engine Datastore. Old: class Logo(db.Model): name = db.StringProperty() image = db.BlobProperty() New: class Logo(db.Model): name = db.StringProperty() image = db.BlobProperty() is_approved = db.BooleanProperty(default=False) How to query for the Logo records, wh...

Formatted text in GAE

Google app engine question: What is a good way to take formatted text (does not have to be rich text) from the user and then store it in a text or blog property in the datastore? Mainly what I'm looking for is it to store newlines and strings of spaces, so that the text comes back looking the same as when it was submitted. ...

get_by_id method on Model classes in Google App Engine Datastore

I'm unable to workout how you can get objects from the Google App Engine Datastore using get_by_id. Here is the model from google.appengine.ext import db class Address(db.Model): description = db.StringProperty(multiline=True) latitude = db.FloatProperty() longitdue = db.FloatProperty() date = db.DateTimeProperty(auto_now_add=T...

Why GQL Query does not match?

What I want to do is build some mini cms which hold pages with a uri. The last route in my urls.py points to a function in my views.py, which checks in the datastore if there's a page available with the same uri of the current request, and if so show the page. I have a model: class Page(db.Model): title = db.StringProperty(require...

How do I order referenced objects from a Google App Engine Datastore query?

I have Exhibit objects which reference Gallery objects both of which are stored in the Google App Engine Datastore. How do I order the Exhibit collection on each Gallery object when I get around to iterating over the values (ultimately in a Django template)? i.e. this does not work class Gallery(db.Model): title = db.StringProperty...

How do I dynamically determine if a Model class exist in Google App Engine?

I want to be able to take a dynamically created string, say "Pigeon" and determine at runtime whether Google App Engine has a Model class defined in this project named "Pigeon". If "Pigeon" is the name of a existant model class, I would like to then get a reference to the Pigeon class so defined. Also, I don't want to use eval at all, s...

how does one upload data in bulk to a google appengine datastore?

I have about 4000 records that i need to upload to the datastore. They are currently in CSV format. I'd appreciate if someone would point me to or explain how to upload data in bulk to GAE. Thank you very much. Help appreciated. ...

Google Web Toolkit (GWT) + Google App Engine (GAE) + Detached Data Persistence

I would like to develop a web-app requiring data persistence using GWT and GAE. As I understand it, my only (or at least by far the most convenient) option for data persistence is GAE's Datastore, using JDO or JPA annotated objects. I would also like to be able to send my objects back and forth client-server using GWT Remote Procedure Ca...

how does one get a count of rows in a datastore model in google appengine?

I need to get a count of records for a particular Model on app engine. How does one do it? I bulk uploaded more than 4000 records but modelname.count() only shows me 1000. ...

How to fetch data by user from google datastore?

I am playing with google app engine and having a bit of trouble on JDOQL queries. The example shows how to fetch stuff from the datastore: PersistenceManager pm = PMF.get().getPersistenceManager(); String query = "select from " + Greeting.class.getName(); List<Greeting> greetings = (List<Greeting>) pm.newQuery(query).execute(); But w...

Usercreated column in AppEngine

Imagine you have a column called usercreated = db.ReferenceProperty(User) And you want this field to automaticly filled when first putted to store. Like this did for auto_date. Is this possible? ...

Is there an easy way to change the parent of a record in google app engine datstore

Given class Category(db.Model): name = db.Stringproperty() Say I have a nested hierarchy -root -a -b c -x -y z1 z2 where a's parent is f, b's parent is a, c's parent is b etc. Is there a simple way by which I could move node y from x to b such that y, z1 and z2 continue to remain children of x & y respectively....

how to get the n-th record of a datastore query

Suppose that I have the model Foo in GAE and this query: query = Foo.all().order('-key') I want to get the n-th record. What is the most efficient way to achieve that? Will the solution break if the ordering property is not unique, such as the one below: query = Foo.all().order('-color') edit: n > 1000 edit 2: I want to develop a ...

datastore transaction restrictions

in my google app application, whenever a user purchases a number of contracts, these events are executed (simplified for clarity): user.cash is decreased user.contracts is increased by the number contracts.current_price is updated. market.no_of_transactions is increased by 1. in a rdms, these would be placed within the same transacti...