Beispiel #1
0
def create_old_datetime():
    default = get_setting('DATETIME_FIELD_DEFAULT')
    if default:
        return default

    # 检查概率设置
    pr = get_setting('DATETIME_FIELD_PR')
    datetime_field_list = get_setting('DATE_FIELD_LIST')
    if pr and is_hit_pr(pr):
        return get_lucky_one(datetime_field_list)
Beispiel #2
0
def create_old_email():
    default = get_setting('EMAIL_FIELD_DEFAULT')
    if default:
        return default

    # 检查概率设置
    pr = get_setting('EMAIL_FIELD_PR')
    char_field_list = get_setting('EMAIL_FIELD_LIST')
    if pr and is_hit_pr(pr):
        return get_lucky_one(char_field_list)
Beispiel #3
0
def create_old_int():
    default = get_setting('INTEGER_FIELD_DEFAULT')
    if default:
        return default

    # 检查概率设置
    pr = get_setting('INTEGER_FIELD_PR')
    integer_field_list = get_setting('INTEGER_FIELD_LIST')
    if pr and is_hit_pr(pr):
        return get_lucky_one(integer_field_list)
Beispiel #4
0
def create_old_float():
    default = get_setting('FLOAT_FIELD_DEFAULT')
    if default:
        return default

    # 检查概率设置
    pr = get_setting('FLOAT_FIELD_PR')
    float_field_list = get_setting('FLOAT_FIELD_LIST')
    if pr and is_hit_pr(pr):
        return get_lucky_one(float_field_list)
Beispiel #5
0
def create_old_password():
    # 小分支,用户名类生成
    # 检查是否有默认值
    default = get_setting('PASSWORD_DEFAULT')
    if default:
        return default

    # 检查概率设置
    pr = get_setting('PASSWORD_PR')
    password_list = get_setting('PASSWORD_LIST')
    if pr and is_hit_pr(pr):
        return get_lucky_one(password_list)
Beispiel #6
0
def create_old_name():
    # 小分支,用户名类生成
    # 检查是否有默认值
    default = get_setting('NAME_DEFAULT')
    if default:
        return default

    # 检查概率设置
    pr = get_setting('NAME_PR')
    name_list = get_setting('NAME_LIST')
    if pr and is_hit_pr(pr):
        return get_lucky_one(name_list)
Beispiel #7
0
def create_old_char(max_length):
    default = get_setting('CHAR_FIELD_DEFAULT')
    if default:
        return default

    # 检查概率设置
    pr = get_setting('CHAR_FIELD_PR')
    char_field_list = get_setting('CHAR_FIELD_LIST')
    if pr and is_hit_pr(pr):
        ret = get_lucky_one(char_field_list)
        if max_length >= len(ret):
            return ret