Using the following models I am trying to figure out a way to generate a news feed of sorts so that when a user logs in they are presented with a list of upcoming events for bars that they choose to follow. Will I be able to query something like “SELECT * FROM Barevent WHERE parent_bar IN UserprofileInstance.following”? If so will this be efficient?
class Barprofile(db.Model):
b_user = db.UserProperty()
created = db.DateTimeProperty(auto_now_add=True)
barname = db.StringProperty()
address = db.PostalAddressProperty()
zipcode = db.StringProperty()
class Barevent(db.Model):
created = db.DateTimeProperty(auto_now_add=True)
when = db.DateProperty()
starttime = db.TimeProperty()
endtime = db.TimeProperty()
description = db.StringProperty(multiline=True)
parent_bar = db.ReferenceProperty(Barprofile, collection_name='bar_events')
class Userprofile(db.Model):
b_user = db.UserProperty()
following = db.ListProperty(db.Key)