Here is an example of StructuredProperty from the docs:
class Address(ndb.Model):
type = ndb.StringProperty() # E.g., 'home', 'work'
street = ndb.StringProperty()
city = ndb.StringProperty()
class Contact(ndb.Model):
name = ndb.StringProperty()
addresses = ndb.StructuredProperty(Address, repeated=True)
guido = Contact(name='Guido',
addresses=[Address(type='home',
city='Amsterdam'),
Address(type='work',
street='Spear St',
city='SF')])
guido.put()
Imagine that Guido is temporarily in the city of Timbuktu, Mali for work. How would I go about retrieving and updating just his work address?
Thanks.
I’d try something like this.
EDIT
added a colon