Beispiel #1
0
def update(_id):
    update_dict = format_request_params(
        get_request_params(),
        model.default_values,
        int_keys_processor(model.int_keys),
        # resource_processor=resource_processor(['thumbnail', 'image'], require=False),
        begin_processors=list_processor('image_list'),
    )
    update_obj(_id, update_dict)
    return Resp.ok()
Beispiel #2
0
def add():
    data = format_request_params(
        get_request_params(),
        model.default_values,
        int_keys_processor(model.int_keys),
        # resource_processor=resource_processor(['thumbnail', 'image'], require=True),
        begin_processors=list_processor('image_list'),
        full_fields=True)
    create_obj(data)
    return Resp.ok()
Beispiel #3
0
def update(_id, total_cost_num, lottery_cost_value):
    update_data = format_request_params(
        get_request_params(),
        model.default_values, [
            int_keys_processor(model.int_keys),
            datetime_keys_processor(['date_list'], '%Y/%m/%d')
        ],
        convert_object_id=True,
        begin_processors=list_processor(['date_list', 'hour_list']))
    update_obj(_id, update_data, total_cost_num, lottery_cost_value)
    return Resp.ok()
Beispiel #4
0
def config_update():
    update_data = format_request_params(get_request_params(),
                                        model.default_values,
                                        int_keys_processor(model.int_keys),
                                        convert_object_id=True,
                                        begin_processors=list_processor(
                                            ['hour_list']))
    if update_data.has_key('hour_list'):
        update_data['hour_list'] = sorted(update_data['hour_list'])
    update_config(update_data)
    return Resp.ok()
Beispiel #5
0
def add(total_cost_num, lottery_cost_value):
    data = format_request_params(
        get_request_params(),
        model.default_values, [
            int_keys_processor(model.int_keys),
            datetime_keys_processor(['date_list'], '%Y/%m/%d')
        ],
        convert_object_id=True,
        begin_processors=list_processor(['date_list', 'hour_list']),
        full_fields=True)
    data['date_list'] = sorted(data['date_list'])
    data['hour_list'] = sorted(data['hour_list'])
    create_obj(data, total_cost_num, lottery_cost_value)
    return Resp.ok()