python - Multiple inheritance mixing ndb.Model with PolyModel in AppEngine -
in application using base model hold general properties, simple subclass of ndb.model. however, of functionality helpful able leverage polymodel functionality. both model , polymodel supposedly support multiple inheritance, question is, there caveats of doing below?
from google.appengine.ext import ndb google.appengine.ext.ndb import polymodel class internalbase(ndb.model): # fields, methods shared many sub-models class widget(polymodel.polymodel, internalbase): # widget-general class textwidget(widget): # widget-specific class htmlwidget(widget): # widget-specific
the goal have basic properties , methods internalbase available widget class able search subclasses of widget using single query (which polymodel adds).
also, think of test-case expose potential problem such scheme?
Comments
Post a Comment