code: def many_to_one(clsname, **kw):
      
      @declared_attr
      def m2o(cls):
          cls._references((cls.__name__, clsname))
          return relationship(clsname, **kw)
      return m2o
docs: Use an event to build a many-to-one relationship on a class.
  
      This makes use of the :meth:`.References._reference_table` method
      to generate a full foreign key relationship to the remote table.