Example #1
0
 def get(self):
     return jsonify([suggestion_to_json(s) for s in Suggestion.select(lambda t : True)])
Example #2
0
 def post(self):
     return suggestion_to_json(add_new_suggestion(request.json["title"], request.json["text"], request.json["author"]))
Example #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)])
Example #4
0
 def get(self, id):
     return suggestion_to_json(Suggestion[id])
Example #5
0
    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])