GetProjectModel.py 489 B

123456789101112131415161718192021
  1. from flask import jsonify
  2. from flask.views import View
  3. from pycs.database.Project import Project
  4. class GetProjectModel(View):
  5. """
  6. return the model used by a given project
  7. """
  8. # pylint: disable=arguments-differ
  9. methods = ['GET']
  10. def dispatch_request(self, user: str, project_id: int):
  11. # pylint: disable=unused-argument
  12. # find project
  13. project = Project.get_or_404(project_id)
  14. # return model
  15. return jsonify(project.model)