def priorities_get(request): c = {} c.update(csrf(request)) data = request.POST["prior"] print(data) dt = choose_date.Choose_date() st = dt.chooseDate() camp_slot = '' cis = check_in_status.Check_in_status() if json.loads(data)["data"][0]["date_id"] == "1": camp_slot = json.loads(st)["data"][0]["camp_time_slots1"] elif json.loads(data)["data"][0]["date_id"] == "2": camp_slot = json.loads(st)["data"][0]["camp_time_slots2"] elif json.loads(data)["data"][0]["date_id"] == "3": camp_slot = json.loads(st)["data"][0]["camp_time_slots3"] st_get = cis.getCheckInStatus('{"data" :[{"camp_time_slots":"' + camp_slot + '"}]}') print(camp_slot) front_end_str111 = '{"data" :[{"camp_time_slots":"' + camp_slot + '"}]}' try: pr = priorities.Priorities() st = pr.getCustomerPriorities(front_end_str111) except Exception as e: st = e return HttpResponse(st, content_type="application/type")
def application_status_get(request): try: dt = choose_date.Choose_date() st = dt.chooseDate() except Exception as e: st = e return HttpResponse(st, content_type="application/type")
def test_submit_checkin(request): c = {} c.update(csrf(request)) data = request.POST["vol_name"] print("data" + data) try: dt = choose_date.Choose_date() st = dt.chooseDate() print(st) cis = check_in_status.Check_in_status() st_get = cis.updateCheckInStatus( data ) #json.dumps({"data" :[{"camp_time_slots":"2016-10-15 00:00:00.000000"}]})) print(st_get) except Exception as e: st_get = e print(st_get) return HttpResponse(st_get, content_type="application/type")
def assignment_tribe(request): c = {} c.update(csrf(request)) data = request.POST["tribe"] dt = choose_date.Choose_date() st = dt.chooseDate() print(st) cis = application_status.Application_status() if json.loads(data)["data"][0]["date_id"] == "1": camp_slot = json.loads(st)["data"][0]["camp_time_slots1"] elif json.loads(data)["data"][0]["date_id"] == "2": camp_slot = json.loads(st)["data"][0]["camp_time_slots2"] elif json.loads(data)["data"][0]["date_id"] == "3": camp_slot = json.loads(st)["data"][0]["camp_time_slots3"] front_end_str = '{"data" :[{"camp_time_slots":"' + camp_slot + '","no_of_tribes":"' + json.loads( data)["data"][0]["no_of_tribes"] + '"}]}' aob = assignment_of_tribes.Assignment_of_tribes() st = aob.readTribesData(front_end_str) return HttpResponse(st, content_type="application/type")
def test_js_check_in(request): c = {} c.update(csrf(request)) data = request.POST["vol_name"] try: dt = choose_date.Choose_date() st = dt.chooseDate() camp_slot = '' apps = check_in_status.Check_in_status() if json.loads(data)["data"][0]["date_id"] == "1": camp_slot = json.loads(st)["data"][0]["camp_time_slots1"] elif json.loads(data)["data"][0]["date_id"] == "2": camp_slot = json.loads(st)["data"][0]["camp_time_slots2"] elif json.loads(data)["data"][0]["date_id"] == "3": camp_slot = json.loads(st)["data"][0]["camp_time_slots3"] st_get = apps.getCheckInStatus('{"data" :[{"camp_time_slots":"' + camp_slot + '"}]}') except Exception as e: st_get = e print(st_get) return HttpResponse(st_get, content_type="application/type")
import sys import json import ast sys.path.append("Python/User_Stories") import choose_date #front_end_str1 = json.dumps({"data" :[{"date_id":"1"}]}) #front_end_str1 = json.dumps({"data" :[{"date_id":"2"}]}) #front_end_str1 = json.dumps({"data" :[{"date_id":"1"}]}) dt = choose_date.Choose_date() st = dt.chooseDate() print(st)