19 lines
485 B
Python
19 lines
485 B
Python
|
from DBHelper.MongoHelperInstance import DB_TEST
|
||
|
from Utils.CommonUtil import CommonUtils
|
||
|
|
||
|
|
||
|
class QuestionnaireUtils(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
|