apiviews.py 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. from sports.serializers import *
  2. from rest_framework import viewsets, permissions
  3. from sports.models import *
  4. class SportsmanMVS(viewsets.ModelViewSet):
  5. queryset = Sportsman.objects.all()
  6. serializer_class = SportsmanSerializer
  7. #permission_classes = [IsOwnerOrReadOnly]
  8. #permission_classes = [permissions.IsAuthenticated]
  9. class SportMVS(viewsets.ModelViewSet):
  10. queryset = Sport.objects.all()
  11. serializer_class = SportSerializer
  12. #permission_classes = [IsOwnerOrReadOnly]
  13. #permission_classes = [permissions.IsAuthenticated]
  14. class EventMVS(viewsets.ModelViewSet):
  15. queryset = Event.objects.all()
  16. serializer_class = EventSerializer
  17. #permission_classes = [IsOwnerOrReadOnly]
  18. #permission_classes = [permissions.IsAuthenticated]
  19. class SportPreferrenceMVS(viewsets.ModelViewSet):
  20. queryset = SportPreferrence.objects.all()
  21. serializer_class = SportPreferrenceSerializer
  22. #permission_classes = [IsOwnerOrReadOnly]
  23. #permission_classes = [permissions.IsAuthenticated]
  24. class EventGalleryMVS(viewsets.ModelViewSet):
  25. queryset = EventGallery.objects.all()
  26. serializer_class = EventGallerySerializer
  27. #permission_classes = [IsOwnerOrReadOnly]
  28. #permission_classes = [permissions.IsAuthenticated]
  29. class SportsmanGalleryMVS(viewsets.ModelViewSet):
  30. queryset = SportsmanGallery.objects.all()
  31. serializer_class = SportsmanGallerySerializer
  32. #permission_classes = [IsOwnerOrReadOnly]
  33. #permission_classes = [permissions.IsAuthenticated]
  34. class AchievementsMVS(viewsets.ModelViewSet):
  35. queryset = Achievements.objects.all()
  36. serializer_class = AchievementsSerializer
  37. #permission_classes = [IsOwnerOrReadOnly]
  38. #permission_classes = [permissions.IsAuthenticated]
  39. class AchievementMVS(viewsets.ModelViewSet):
  40. queryset = Achievement.objects.all()
  41. serializer_class = AchievementSerializer
  42. #permission_classes = [IsOwnerOrReadOnly]
  43. #permission_classes = [permissions.IsAuthenticated]
  44. class SavedEventMVS(viewsets.ModelViewSet):
  45. queryset = SavedEvent.objects.all()
  46. serializer_class = SavedEventSerializer
  47. #permission_classes = [IsOwnerOrReadOnly]
  48. #permission_classes = [permissions.IsAuthenticated]
  49. class SavedSportsmanMVS(viewsets.ModelViewSet):
  50. queryset = SavedSportsman.objects.all()
  51. serializer_class = SavedSportsmanSerializer
  52. #permission_classes = [IsOwnerOrReadOnly]
  53. #permission_classes = [permissions.IsAuthenticated]
  54. class BlockedSportsmanMVS(viewsets.ModelViewSet):
  55. queryset = BlockedSportsman.objects.all()
  56. serializer_class = BlockedSportsmanSerializer
  57. #permission_classes = [IsOwnerOrReadOnly]
  58. #permission_classes = [permissions.IsAuthenticated]
  59. class ParticipantMVS(viewsets.ModelViewSet):
  60. queryset = Participant.objects.all()
  61. serializer_class = ParticipantSerializer
  62. #permission_classes = [IsOwnerOrReadOnly]
  63. #permission_classes = [permissions.IsAuthenticated]
  64. class BrowseEventMVS(viewsets.ModelViewSet):
  65. queryset = BrowseEvent.objects.all()
  66. serializer_class = BrowseEventSerializer
  67. #permission_classes = [IsOwnerOrReadOnly]
  68. #permission_classes = [permissions.IsAuthenticated]
  69. class BrowseSportsmanMVS(viewsets.ModelViewSet):
  70. queryset = BrowseSportsman.objects.all()
  71. serializer_class = BrowseSportsmanSerializer
  72. #permission_classes = [IsOwnerOrReadOnly]
  73. #permission_classes = [permissions.IsAuthenticated]