Here are my models:
class User(db.Model):
id = db.StringProperty(required=True)
created = db.DateTimeProperty(auto_now_add=True)
updated = db.DateTimeProperty(auto_now=True)
name = db.StringProperty(required=True)
email = db.StringProperty()
class Page(db.Model):
id = db.StringProperty(required=True)
created = db.DateTimeProperty(auto_now_add=True)
updated = db.DateTimeProperty(auto_now=True)
name = db.StringProperty(required=True)
link = db.StringProperty(required=True)
class UserPage(db.Model):
user = db.ReferenceProperty(User, collection_name='pages')
page = db.ReferenceProperty(Page, collection_name='users')
How would I construct a query to find a users pages?
I found an article that describes a method to do it but is this the best way? http://blog.arbingersys.com/2008/04/google-app-engine-better-many-to-many.html