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