123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- from pycs_api.views.base import JsonResponseView
- from django.views.decorators.http import require_POST
- class ProjectView(JsonResponseView):
- """
- serves POST and GET for '/projects/'
- staticmethods serve POST methods for
- '/projects/<id>/name'
- '/projects/<id>/description'
- '/projects/<id>/remove'
- """
- http_method_names = ["get", "post"]
- def get(self, request, *args, **kwargs):
- """ lists projects """
- return self.respond()
- def post(self, request, *args, **kwargs):
- """ creates a project """
- return self.respond()
- @require_POST
- @classmethod
- def remove(cls, request, project_id: int):
- """ removes a project """
- return cls.respond()
- @require_POST
- @classmethod
- def edit_name(cls, request, project_id: int):
- """ edit project's name """
- return cls.respond()
- @require_POST
- @classmethod
- def edit_description(cls, request, project_id: int):
- """ edit project's description """
- return cls.respond()
- @require_POST
- @classmethod
- def run_external_storage(cls, request, project_id: int):
- """ runs external storage routine """
- return cls.respond()
- @require_POST
- @classmethod
- def run_label_provider(cls, request, project_id: int):
- """ runs label provider routine """
- return cls.respond()
|