How to order by the field stored in the separate model?
问题 Here is simplified version of my datastore structure: class News(db.Model): title = db.StringProperty() class NewsRating(db.Model): user = db.IntegerProperty() rating = db.IntegerProperty() news = db.ReferenceProperty(News) Now I need to display all news sorted by their total rating (sum of different users ratings). How can I do that in the following code: news = News.all() # filter by additional parms # news.filter("city =", "1") news.order("-added") # ? for one_news in news: self.response