123456789101112131415161718192021 |
- from flask import abort, jsonify
- from flask.views import View
- from pycs.database.Project import Project
- class GetProjectModel(View):
- """
- return the model used by a given project
- """
- # pylint: disable=arguments-differ
- methods = ['GET']
- def dispatch_request(self, identifier):
- # find project
- project = Project.query.get(identifier)
- if project is None:
- abort(404)
- # return model
- return jsonify(project.model)
|