6
0

project.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. from pycs_api.views.base import JsonResponseView
  2. from django.views.decorators.http import require_POST
  3. class ProjectView(JsonResponseView):
  4. """
  5. serves POST and GET for '/projects/'
  6. staticmethods serve POST methods for
  7. '/projects/<id>/name'
  8. '/projects/<id>/description'
  9. '/projects/<id>/remove'
  10. """
  11. http_method_names = ["get", "post"]
  12. def get(self, request, *args, **kwargs):
  13. """ lists projects """
  14. return self.respond()
  15. def post(self, request, *args, **kwargs):
  16. """ creates a project """
  17. return self.respond()
  18. @require_POST
  19. @classmethod
  20. def remove(cls, request, project_id: int):
  21. """ removes a project """
  22. return cls.respond()
  23. @require_POST
  24. @classmethod
  25. def edit_name(cls, request, project_id: int):
  26. """ edit project's name """
  27. return cls.respond()
  28. @require_POST
  29. @classmethod
  30. def edit_description(cls, request, project_id: int):
  31. """ edit project's description """
  32. return cls.respond()
  33. @require_POST
  34. @classmethod
  35. def run_external_storage(cls, request, project_id: int):
  36. """ runs external storage routine """
  37. return cls.respond()
  38. @require_POST
  39. @classmethod
  40. def run_label_provider(cls, request, project_id: int):
  41. """ runs label provider routine """
  42. return cls.respond()