def by_owner(cls, session, owner_name):
        """
        Get packages from a given owner username.

        :param session: SQLAlchemy session
        :type session: :class:`sqlalchemy.Session`

        :param owner_name: owner username
        :type owner_name: unicode

        :return: package instances
        :rtype: generator of :class:`pyshop.models.Package`
        """
        return cls.find(session,
                        join=(cls.owners),
                        where=(User.login == owner_name,),
                        order_by=cls.name)