Create a query like this:
query = PersonalPost.all() query.filter('user_id', user_id) query.order('-created')
or use: With single quotes around '% s' !!
personalposts = db.GqlQuery("select * from PersonalPost where user_id = '%s' order by created desc" % user_id)
source share