@classmethod<EOL><INDENT>def plugin_for(cls, model):<DEDENT>
logger.debug("<STR_LIT>", model)<EOL>if not issubclass(model, Model):<EOL><INDENT>return<EOL><DEDENT>if model in cls.plugins:<EOL><INDENT>return cls.plugins[model]<EOL><DEDENT>for b in model.__bases__:<EOL><INDENT>p = cls.plugin_for(b)<EOL>if p:<EOL><INDENT>return p<EOL><DEDENT><DEDENT>
Find and return a plugin for this model. Uses inheritance to find a model where the plugin is registered.