def get(self): return jsonify( [suggestion_to_json(s) for s in Suggestion.select(lambda t: True)])
def add_new_suggestion(title_inp, text_inp, author_inp): return Suggestion(timestamp=datetime.utcnow(), title=title_inp, text=text_inp, author=author_inp)
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)])