@@ -34,21 +34,33 @@ def get_social_media(self, obj):
3434
3535class GamesSerializer (serializers .ModelSerializer ):
3636 contributors = GameContributorSerializer (
37- many = True ,
38- source = "game_contributors" ,
39- read_only = True
37+ many = True , source = "game_contributors" , read_only = True
4038 )
4139
4240 class Meta :
4341 model = Game
44- fields = ('id' , 'name' , 'description' , 'completion' , 'active' , 'hostURL' , 'itchEmbedID' , 'thumbnail' , 'event' , 'itchGameEmbedID' ,
45- 'itchGameWidth' , 'itchGameHeight' , "contributors" )
42+ fields = (
43+ "id" ,
44+ "name" ,
45+ "description" ,
46+ "completion" ,
47+ "active" ,
48+ "hostURL" ,
49+ "itchEmbedID" ,
50+ "thumbnail" ,
51+ "event" ,
52+ "itchGamePlayableID" ,
53+ "itchGameWidth" ,
54+ "itchGameHeight" ,
55+ "contributors" ,
56+ )
4657
4758
4859# Contributor serializer for name and role
4960
61+
5062class ShowcaseContributorSerializer (serializers .ModelSerializer ):
51- name = serializers .CharField (source = ' member.name' , read_only = True )
63+ name = serializers .CharField (source = " member.name" , read_only = True )
5264 role = serializers .CharField (read_only = True )
5365 social_media = serializers .SerializerMethodField ()
5466
@@ -63,18 +75,24 @@ def get_social_media(self, obj):
6375
6476# Serializer for GameShowcase
6577class GameshowcaseSerializer (serializers .ModelSerializer ):
66- game_id = serializers .IntegerField (source = 'game.id' , read_only = True )
67- game_name = serializers .CharField (source = 'game.name' , read_only = True )
68- game_description = serializers .CharField (
69- source = 'game.description' , read_only = True )
78+ game_id = serializers .IntegerField (source = "game.id" , read_only = True )
79+ game_name = serializers .CharField (source = "game.name" , read_only = True )
80+ game_description = serializers .CharField (source = "game.description" , read_only = True )
7081 game_cover_thumbnail = serializers .ImageField (
71- source = 'game.thumbnail' , read_only = True )
82+ source = "game.thumbnail" , read_only = True
83+ )
7284 contributors = serializers .SerializerMethodField ()
7385
7486 class Meta :
7587 model = GameShowcase
76- fields = ('game_id' , 'game_name' , 'game_description' ,
77- 'description' , 'contributors' , 'game_cover_thumbnail' )
88+ fields = (
89+ "game_id" ,
90+ "game_name" ,
91+ "game_description" ,
92+ "description" ,
93+ "contributors" ,
94+ "game_cover_thumbnail" ,
95+ )
7896
7997 def get_contributors (self , obj ):
8098 # Always fetch contributors from GameContributor for the related game
@@ -93,15 +111,9 @@ class Meta:
93111
94112class MemberSerializer (serializers .ModelSerializer ):
95113 social_media = SocialMediaSerializer (
96- many = True , source = "social_media_links" , read_only = True )
114+ many = True , source = "social_media_links" , read_only = True
115+ )
97116
98117 class Meta :
99118 model = Member
100- fields = [
101- "name" ,
102- "profile_picture" ,
103- "about" ,
104- "pronouns" ,
105- "social_media" ,
106- "pk"
107- ]
119+ fields = ["name" , "profile_picture" , "about" , "pronouns" , "social_media" , "pk" ]
0 commit comments