Tuesday, 24 September 2013

Google App Engine: Querying the datastore, WHERE clause refers to a reference property

This is exactly the sort of thing you cannot do with the App Engine datastore. It is not a relational database, and you cannot query it as one. One of the things this implies is that it does not support JOINs, and you cannot do queries across entity types.

Because of this, it is usually not a good idea to follow the full normalized form in creating your data models. Unless you have a very good reason for keeping them separate, ContactInfo should almost certainly be merged with Owner. You might also want to define a repeated ReferenceProperty on Owner that records books_owned: then you can do a simple query and some gets to get all the books:

owners = db.Query(Owner).filter('zipcode', 12345) books = [] for owner in owners:     book_ids.extend(owner.books_owned) books = db.get(book_ids) 

Source: http://stackoverflow.com/questions/18952236/google-app-engine-querying-the-datastore-where-clause-refers-to-a-reference-pr

act Henry Blackaby First Day Of Fall 2013 jennette mccurdy powerball eagles christina aguilera

No comments:

Post a Comment