@classmethod
def get_by_user(cls, user_id, desc=True, offset=0, limit=10, session=None):
    """Get the related object of a user.

        :param string/int user_id: The ID (if int) or UUID (if string) of the
            user.
        :param bool desc: Whether to sort DESC. Default is ``True``.
        :param integer offset: The offset of the objects. If limit is 10 and
            offset is 5, the function will attempt to get the 6th to 15th
            most recent objects.
        :param integer limit: The max number of objects to get.
        :param Session session: The optional SQL session.
        :returns list<UserRelationMixin>: The list of objects matching the
            requirement.
        """
    column = 'user_id' if isinstance(user_id, int) else 'user_uuid'
    return cls.get_multi(column, user_id, cls.sort_key, desc=desc, offset=
        offset, limit=limit, session=session)
