I have an app on GAE that lets user add\edit posts to any arbitrary path (like a wiki). I am storing all the posts in a single table. The table is structured as follows:
class WikiPosts(db.Model):
path = db.StringProperty(required = True)
content = db.TextProperty(required = True)
date_created = db.DateTimeProperty(auto_now_add = True)
On the home page I want to display the latest post for each path.
My question is similar to this one ( Select first row in each GROUP BY group? ) but the answers involve using join which is not possible in GAE.
I can have a dedicated field to keep track of the latest post for each url but is it possible to do it using gql query?
As of now, I am using this query which returns all the versions of all the wiki posts sorted by their creation time.
db.GqlQuery("SELECT * FROM WikiPosts ORDER BY date_created DESC limit=10")