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