PolyModel ベースのクラスは SelfReferenceProperty として使用できますか?
私は以下のコードを持っています:
class BaseClass(polymodel.PolyModel):
attribute1 = db.IntegerProperty()
attribute2 = db.StringProperty()
class ParentClass(BaseClass):
attribute3 = db.StringProperty()
class ChildClass(BaseClass):
parent = db.SelfReferenceProperty(collection_name = 'children')
p = ParentClass()
p.attribute1 = 1
p.attribute2 = "Parent Description"
p.attribute3 = "Parent additional data"
p.put()
c = ChildClass()
c.attribute1 = 5
c.attribute2 = "Child Description"
c.parent = p.key()
c.put()
このコードを実行し、開発サーバーの管理インターフェイスを介してデータストアをチェックします。親インスタンスはデータストア クラス = 'BaseClass,ParentClass' に保存されますが、子は保存されません。ブラウザーへのエラー出力はなく (デバッグがオンになっています)、アプリのランチャーのログには何もありません。
これは可能ですか?