I have some models set up like:
class Apps(db.Model):
name = db.StringProperty(multiline=False)
description = db.TextProperty()
class AppScreenshots(db.Model):
image_file = db.StringProperty(multiline=False)
description = db.StringProperty(multiline=False)
app = db.ReferenceProperty(Apps)
I'm trying to reference a "parent" app in a screenshot like so:
a = Apps.get(app_key)
ss = AppScreenshots(
image_file = 'foo',
description = 'bar',
app = a
)
ss.put()
But it complains to me saying:
BadArgumentError('_app should be a string; received ag1raWxsZXItcm9ib3RzcgoLEgRBcHBzGAkM (a Key):',)
I've tried going over a few examples on the internet and they all seem to work JUST like the above. One set of documentation Google has up suggests doing it a little differently, like this:
a = Apps.get(app_key)
ss = AppScreenshots(
image_file = 'foo',
description = 'bar',
app = a.key()
)
ss.put()
But that gives me the exact same error.
What am I doing wrong?