Beispiel #1
0
def set_default_db(request):
    if Sido.objects.all().count() == 0:
        set_sido_info()

    if KindCd.objects.all().count() == 0:
        set_kind_info()

    return ok('Default Value Set')
Beispiel #2
0
def abandonment(request):
    querys = get_querys(request)
    rslt = get_abandonment(querys)
    if not isinstance(rslt['rslt'], list):
        logging.error(pformat(rslt['rslt']))
        return error(rslt, msg="Open API Server Error")

    return ok(rslt)
Beispiel #3
0
def shelter_nearby(request):
    querys = get_querys(request)
    rslt = get_shelter_nearby(querys)
    if not isinstance(rslt['rslt'], list):
        logging.error(pformat(rslt['rslt']))
        return error(rslt, msg="Open API Server Error")

    return ok(rslt)
Beispiel #4
0
def sido(request):
    try:
        sido = Sido.objects.all()
    except Sido.DoesNotExist:
        return error("", msg="Sido data does not exist.")

    serializer = SidoSerializer(sido, many=True)
    rslt = make_response_content(response_data=serializer.data, req_param={}, info_data={})

    return ok(rslt)
Beispiel #5
0
def kind_cd(request):
    try:
        kind_cd = KindCd.objects.all()
    except KindCd.DoesNotExist:
        return error("", msg="Sido data does not exist.")

    serializer = KindCdSerializer(kind_cd, many=True)
    rslt = make_response_content(response_data=serializer.data, req_param={}, info_data={})

    return ok(rslt)
Beispiel #6
0
def sigungu(request):
    querys = get_querys(request)
    try:
        sigungu = Sigungu.objects.filter(sidoCd=querys['upr_cd'])
    except Sigungu.DoesNotExist:
        return error("", msg="Sido data does not exist.")

    serializer = SigunguSerializer(sigungu, many=True)
    rslt = make_response_content(response_data=serializer.data, req_param=querys, info_data={})

    return ok(rslt)