def get(self): return jsonify([suggestion_to_json(s) for s in Suggestion.select(lambda t : True)])
def post(self): return suggestion_to_json(add_new_suggestion(request.json["title"], request.json["text"], request.json["author"]))
def get(self): if request.headers.get('Authorization') != config.PRIT_AUTH_KEY: return 'You are not P.R.I.T.', 401 return jsonify([suggestion_to_json(s) for s in Suggestion.select(lambda t : True)])
def get(self, id): return suggestion_to_json(Suggestion[id])
def get(self, id): if request.headers.get('Authorization') != config.PRIT_AUTH_KEY: return 'You are not P.R.I.T.', 401 return suggestion_to_json(Suggestion[id])