Adding A Structuredproperty To A Model In Ndb
(couldn't think of a better title :S ) So I've recently changed from db to ndb and i can't get one part to work. I have this tutorial model that has chapters, so I am using 'ndb.St
Solution 1:
You seem to be confused. When using StructuredProperty
, the contained object doesn't have its own ID or key -- it's just more properties with funny names in the outer object. Perhaps you want a repeated KeyProperty
linking the book to its chapters rather than having all the chapters contained inside the book? You have to choose one or the other.
Solution 2:
You are dealing with a list... you need to append the object to the list
tutorialInstance.chapters.append(chap)
Post a Comment for "Adding A Structuredproperty To A Model In Ndb"