I have a situation in which a Model that I use has a number of properties needed for all entities and a few that are specific to one of two alternatives, like in the following example:
class Machine(ndb.Model):
#Properties for all machines:
price = ndb.FloatProperty()
model = ndb.StringProperty()
vendor = ndb.KeyProperty()
#...
#Properties exclusive to type A machines:
foo1 = ndb.StringProperty()
foo2 = ndb.StringProperty()
#Properties exclusive to type B machines:
bar1 = ndb.StringProperty()
bar2 = ndb.StringProperty()
From what I understand, I could take one of two paths. Either I make it a regular ndb.Model and just leave some properties without content or I could use an ndb.Expando Model and set the fixed properties in advance and just add the others depending on the case.
As I understand it, the Expando Model is useful when you don't know the properties that you will need, but I do know in advance all the properties needed (foo1, foo2, bar1, bar2). Should I use Expando or is it alright to use a regular ndb.Model and leave a few properties blank for each entity?