コード例 #1
0
ファイル: region.py プロジェクト: liuzelei/walis
def post():
    dic = args_parser.parse_all()
    if not check_region_post():
        raise_auth_exc(AUTH_FAILED_ERROR)
    dic['area'] = front_area_to_back_area(dic['_area'])
    result = region_base.post(None, dic)
    if dic['type_code'] == WHITE_COLLAR_TYPE_CODE:
        white_collar_base.update_building_region(result, dic['_area'])
    return result
コード例 #2
0
def post():
    dic = args_parser.parse_all()
    if not check_region_post():
        raise_auth_exc(AUTH_FAILED_ERROR)
    dic['area'] = front_area_to_back_area(dic['_area'])
    result = region_base.post(None, dic)
    if dic['type_code'] == WHITE_COLLAR_TYPE_CODE:
        white_collar_base.update_building_region(result, dic['_area'])
    return result
コード例 #3
0
ファイル: region.py プロジェクト: liuzelei/walis
def put(pk):
    pk = int(pk)
    if not check_region(pk=pk):
        raise_auth_exc(AUTH_FAILED_ERROR)
    dic = args_parser.parse_all()
    region = region_base.get(pk)
    dic['area'] = front_area_to_back_area(dic['_area'])
    result = region_base.put(pk, dic)
    if region['type_code'] == WHITE_COLLAR_TYPE_CODE and dic['type_code'] != WHITE_COLLAR_TYPE_CODE:
        white_collar_base.delete_by_region(result)
    if dic['type_code'] == WHITE_COLLAR_TYPE_CODE:
        white_collar_base.update_building_region(result, dic['_area'])
    return result
コード例 #4
0
def put(pk):
    pk = int(pk)
    if not check_region(pk=pk):
        raise_auth_exc(AUTH_FAILED_ERROR)
    dic = args_parser.parse_all()
    region = region_base.get(pk)
    dic['area'] = front_area_to_back_area(dic['_area'])
    result = region_base.put(pk, dic)
    if region['type_code'] == WHITE_COLLAR_TYPE_CODE and dic[
            'type_code'] != WHITE_COLLAR_TYPE_CODE:
        white_collar_base.delete_by_region(result)
    if dic['type_code'] == WHITE_COLLAR_TYPE_CODE:
        white_collar_base.update_building_region(result, dic['_area'])
    return result