from DBHelper.MongoHelperInstance import DB_TEST from Utils.CommonUtil import CommonUtils class QuestionUtils(object): @staticmethod def make_new_cid(): new_cid = CommonUtils.random_code(8) case = DB_TEST.find_single_column( "模型数据", "问题数据", {"问题ID": new_cid}, "问题ID" ) is not None while case: new_cid = CommonUtils.random_code(8) return new_cid