def settings():
# returns data about the current settings
i = inspect(db.engine)
cols = i.get_columns("Settings")
ignore = [
'id',
'questions',
'required_ids',
'response_body',
'min_age_word']
out = {}
for col in cols:
# don't include things that can't be modified in the settings menu
if col["name"].lower() in ignore:
continue
col_dict = {}
col_dict["value"] = getattr(g.settings, col["name"])
col_dict["type"] = type(col_dict["value"]).__name__
out[col["name"].lower()] = col_dict
return Response(json.dumps(out), mimetype="application/json")
评论列表
文章目录