123456789101112131415161718192021222324 |
- from flask import abort, jsonify
- from flask.views import View
- from pycs.database.Database import Database
- class ListLabels(View):
- """
- return a list of labels for a given project
- """
- # pylint: disable=arguments-differ
- methods = ['GET']
- def __init__(self, db: Database):
- # pylint: disable=invalid-name
- self.db = db
- def dispatch_request(self, identifier):
- # find project
- project = self.db.project(identifier)
- if project is None:
- abort(404)
- return jsonify(project.labels.all())
|