1234567891011121314151617181920 |
- from flask import abort, jsonify
- from flask.views import View
- from pycs.database.Project import Project
- class ListLabels(View):
- """
- return a list of labels for 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 jsonify(project.labels.all())
|