2
votes

With db it appears it was myexpando.dynamic_properties(), but trying to do that in ndb I get an AttributeError for dynamic_properties.

Can't find anything in the docs about a change to this.

1

1 Answers

4
votes

When you are using ndb you should be using _properties to get the list of properties

    The db, ndb, users, urlfetch, and memcache modules are imported.
dev~cash-drawer> class X(ndb.Expando):
...    pass
... 
dev~cash-drawer> 
dev~cash-drawer> 
dev~cash-drawer> y = X()
dev~cash-drawer> y.a = ndb.GenericProperty()
dev~cash-drawer> y.a = 100
dev~cash-drawer> y.a
100
dev~cash-drawer> repr(y.a)
'100'
dev~cash-drawer> type(y.a)
<type 'int'>
dev~cash-drawer> y._properties
{'a': GenericProperty('a')}
dev~cash-drawer> 

See docs https://developers.google.com/appengine/docs/python/ndb/entities#expando