def by_name(cls, session, name):
        """
        Get a package from a given name.

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

        :param name: name of the group
        :type name: `unicode

        :return: package instance
        :rtype: :class:`pyshop.models.Group`
        """
        return cls.first(session, where=(cls.name == name,))