def templates(): if request.method == "GET": org_id = 1 templates = Shift.create_templates(1) json_templates = json.dumps(templates) return render_template("templates.html",params={}) if request.method == "POST": org_id = 1 # get from user chosen_template = 1 # get from user Shift.create_from_template(org_id, chosen_template) # create shifts in DB
def templates_info(): if request.method == "GET": org_id = 1 # get from user return json.dumps(Shift.create_templates(org_id))