docs: def on(cls, event, handler_func=None):
          """
          Registers a handler function whenever an instance of the model
          emits the given event.
  
          This method can either called directly, passing a function reference:
  
              MyModel.on('did_save', my_function)
  
          ...or as a decorator of the function to be registered.
  
              @MyModel.on('did_save')
              def myfunction(my_model):
                  pass
  
          """
          if handler_func:
              cls.handler_registrar().register(event, handler_func)
              return
  
          def register(fn):
              cls.handler_registrar().register(event, fn)
              return fn
  
          return register