示例#1
0
    def select_user_setting(user, user_setting_id):
        """

        """
        assert isinstance(user, UserEntity)
        assert isinstance(user_setting_id, unicode)
        assert user_setting_id

        try:
            user_setting_entity = UserSettingEntityDAO.select_by_id(user_setting_id)
        except NoResultFound:
            raise ResourceNotFoundException()

        if user_setting_entity.user != user:
            raise ResourceNotFoundException()

        return user_setting_entity
示例#2
0
    def select_user_settings(user):
        """
        """
        assert isinstance(user, UserEntity)

        return UserSettingEntityDAO.select_all_by_user(user)