views:

23

answers:

1

I have two entity kinds in my python GAE app - both with similar attributes - and I'd like to query both lists and order the result according to an attribute common to both kinds. So something along the lines of:

db.GqlQuery("SELECT * FROM Video1, Video2 ORDER BY views DESC").fetch(1000)

Can I do this in GQL directly?

+3  A: 

No. You need to run two queries, one for each kind.

Check out the GQL and GqlQuery class references.

You can actually do a kindless query using db.GqlQuery('SELECT') to fetch everything. However, you can not filter or order it (other than by key).

edit:

You may want to check out PolyModel.

Robert Kluin
thanks for the nod to PolyModel
rutherford