def register_whoosheer(self, wh):
self.whoosheers.append(wh)<EOL>for model in wh.models:<EOL><INDENT>event.listen(model, '<STR_LIT>'.format(INSERT_KWD), self.after_insert)<EOL>event.listen(model, '<STR_LIT>'.format(UPDATE_KWD), self.after_update)<EOL>event.listen(model, '<STR_LIT>'.format(DELETE_KWD), self.after_delete)<EOL>query_class = getattr(model, '<STR_LIT>', None)<EOL>if query_class is not None and isclass(query_class):<EOL><INDENT>if issubclass(query_class, self.query):<EOL><INDENT>pass<EOL><DEDENT>elif query_class not in (BaseQuery, SQLAQuery, WhoosheeQuery):<EOL><INDENT>query_class_name = query_class.__name__<EOL>model.query_class = type(<EOL>"<STR_LIT>".format(query_class_name), (query_class, self.query), {}<EOL>)<EOL><DEDENT>else:<EOL><INDENT>model.query_class = self.query<EOL><DEDENT><DEDENT>else:<EOL><INDENT>model.query_class = self.query<EOL><DEDENT><DEDENT>if self.app:<EOL><INDENT>wh.app = self.app<EOL><DEDENT>return wh<EOL>
This will register the given whoosher on `whoosheers`, create the
        neccessary SQLAlchemy event listeners, replace the `query_class` with
        our own query class which will provide the search functionality
        and store the app on the whoosheer, so that we can always work
        with that.
        :param wh: The whoosher which should be registered.