You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
375 B

  1. import os
  2. import copy
  3. import json
  4. from flask import Flask, request
  5. from flask_restful import Resource, Api, abort
  6. app = Flask(__name__)
  7. api = Api(app)
  8. class Empty(Resource):
  9. def get(self):
  10. try:
  11. rating = copy.deepcopy(ratings[rating_id - 1])
  12. del rating['rates']
  13. return rating
  14. except:
  15. abort(404, error="Rating {} doesn't exist".format(rating_id))