Hi!
I am building an app with Google App Engine (and Python). I have two questions about retrieving data from datastore.
I have information about users and information about posts made by users. Here is part of DB Models:
class User(db.Model):
country = db.StringProperty()
# many other entities
class Post(db.Model):
author = db.ReferenceProperty(User)
# many other entities
I want to retrieve Posts, that are made by users from certain country. I tried it this way:
posts_query = Post.all().filter(' author.country == ', country)
posts = posts_query.fetch(limit = 100)
But this query does not return any results (the country variable has a value that exists in the datastore). What I need to correct in my query, so it works?
And the second question: how (in the given situation) I can retrieve all posts from datastore, if the post count is unknown (and may be > 100)?
Thanks in advance,
-skazhy