serializers.py 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. from rest_framework import serializers
  2. from sports.models import *
  3. class SportsmanSerializer(serializers.ModelSerializer):
  4. class Meta:
  5. model = Sportsman
  6. exclude = ["id"]
  7. class SportSerializer(serializers.ModelSerializer):
  8. class Meta:
  9. model = Sport
  10. exclude = ["id"]
  11. class EventSerializer(serializers.ModelSerializer):
  12. class Meta:
  13. model = Event
  14. exclude = ["id"]
  15. class SportPreferrenceSerializer(serializers.ModelSerializer):
  16. class Meta:
  17. model = SportPreferrence
  18. exclude = ["id"]
  19. class EventGallerySerializer(serializers.ModelSerializer):
  20. class Meta:
  21. model = EventGallery
  22. exclude = ["id"]
  23. class SportsmanGallerySerializer(serializers.ModelSerializer):
  24. class Meta:
  25. model = SportsmanGallery
  26. exclude = ["id"]
  27. class AchievementsSerializer(serializers.ModelSerializer):
  28. class Meta:
  29. model = Achievements
  30. exclude = ["id"]
  31. class AchievementSerializer(serializers.ModelSerializer):
  32. class Meta:
  33. model = Achievement
  34. exclude = ["id"]
  35. class SavedEventSerializer(serializers.ModelSerializer):
  36. class Meta:
  37. model = SavedEvent
  38. exclude = ["id"]
  39. class SavedSportsmanSerializer(serializers.ModelSerializer):
  40. class Meta:
  41. model = SavedSportsman
  42. exclude = ["id"]
  43. class BlockedSportsmanSerializer(serializers.ModelSerializer):
  44. class Meta:
  45. model = BlockedSportsman
  46. exclude = ["id"]
  47. class ParticipantSerializer(serializers.ModelSerializer):
  48. class Meta:
  49. model = Participant
  50. exclude = ["id"]
  51. class BrowseEventSerializer(serializers.ModelSerializer):
  52. class Meta:
  53. model = BrowseEvent
  54. exclude = ["id"]
  55. class BrowseSportsmanSerializer(serializers.ModelSerializer):
  56. class Meta:
  57. model = BrowseSportsman
  58. exclude = ["id"]