How can I get at the Labels data from within my Task model?
class Task(db.Model):
title = db.StringProperty()
class Label(db.Model):
name = db.StringProperty()
class Tasklabel(db.Model):
task = db.ReferenceProperty(Task)
label = db.ReferenceProperty(Label)
creating the association is no problem, but how can I get at the labels associated with a task like:
task = Task.get('...')
for label in task.labels
Don’t you want a ListProperty on Task like this to do a many-to-many?
Then you could do
There’s a thorough article about modeling entity relationships on Google code. I stole the code above from this article.