Polymorphic models and queries.
The standard NDB Model class only supports 'functional polymorphism'.
That is, you can create a subclass of Model, and then subclass that
class, as many generations as necessary, and those classes will share
all the same properties and behaviors of their base classes. However,
subclassing Model in this way gives each subclass its own kind. This
means that it is not possible to do 'polymorphic queries'. Building a
query on a base class will only return entities whose kind matches
that base class's kind, and exclude entities that are instances of
some subclass of that base class.
The PolyModel class defined here lets you create class hierarchies
that support polymorphic queries. Simply subclass PolyModel instead
of Model.