def list_json(): start_record = int(quorum.get_field("start_record")) number_records = int(quorum.get_field("number_records")) if start_record > 0: time.sleep(SLEEP_TIME) items = [] for index in range(number_records): index_f = start_record + index + 1 items.append({ "name" : "Name %d" % index_f, "country" : "Country %d" % index_f }) return items
def options_action(): type = quorum.get_field("type") theme = quorum.get_field("theme") libs = quorum.get_field("libs") type_s = type.split("-", 1) theme_s = theme.split("-", 1) type_l = len(type_s) theme_l = len(theme_s) if type_l == 1: type_s.append("") type_s, sub_type_s = type_s if theme_l == 1: theme_s.append("") theme_s, style_s = theme_s type_s = type_s.lower().strip() sub_type_s = sub_type_s.lower().strip() theme_s = theme_s.lower().strip() style_s = style_s.lower().strip() libs_s = libs.lower().strip() if style_s == "default": style_s = "" flask.session["type_label"] = type flask.session["type"] = type_s flask.session["sub_type"] = sub_type_s flask.session["label"] = theme flask.session["theme"] = theme_s flask.session["style"] = style_s flask.session["libs"] = libs_s flask.session["libs_label"] = libs flask.session.permanent = True return render_template( "options.html.tpl", link = "options", form = {}, errors = {} )