Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions server/game_dev/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ class GameShowcaseAdmin(admin.ModelAdmin):


class GamesAdmin(admin.ModelAdmin):
list_display = ("id", "name", "description", "completion", "active", "hostURL", "itchEmbedID", "thumbnail", "itchGameEmbedID", "itchGameWidth",
"itchGameHeight", "event")
list_display = ("id", "name", "description", "completion", "active", "hostURL", "itchEmbedID", "itchGamePlayableID", "itchGameWidth",
"itchGameHeight", "thumbnail")
search_fields = ["name", "description"]
raw_id_fields = ["event"]


class CommitteeAdmin(admin.ModelAdmin):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class Migration(migrations.Migration):

dependencies = [
('game_dev', '0005_committee'),
('game_dev', '0007_committee'),
]

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class Migration(migrations.Migration):

dependencies = [
('game_dev', '0006_committee_role'),
('game_dev', '0008_committee_role'),
]

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class Migration(migrations.Migration):

dependencies = [
("game_dev", "0006_remove_game_isitch_alter_game_itchembedid"),
("game_dev", "0009_remove_game_isitch_alter_game_itchembedid"),
]

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class Migration(migrations.Migration):

dependencies = [
('game_dev', '0007_alter_committee_id'),
('game_dev', '0010_alter_committee_id'),
]

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class Migration(migrations.Migration):

dependencies = [
("game_dev", "0007_rename_pathtothumbnail_game_thumbnail_and_more"),
("game_dev", "0011_rename_pathtothumbnail_game_thumbnail_and_more"),
]

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
class Migration(migrations.Migration):

dependencies = [
('game_dev', '0005_alter_member_profile_picture'),
('game_dev', '0008_alter_committee_role'),
('game_dev', '0006_alter_member_profile_picture'),
('game_dev', '0012_alter_committee_role'),
]

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
class Migration(migrations.Migration):

dependencies = [
('game_dev', '0005_alter_member_profile_picture'),
('game_dev', '0008_alter_event_date'),
('game_dev', '0006_alter_member_profile_picture'),
('game_dev', '0013_alter_event_date'),
]

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class Migration(migrations.Migration):

dependencies = [
("game_dev", "0009_merge_20260131_1044"),
("game_dev", "0015_merge_20260131_1044"),
]

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
class Migration(migrations.Migration):

dependencies = [
('game_dev', '0009_merge_20260129_2104'),
('game_dev', '0009_merge_20260131_1044'),
('game_dev', '0014_merge_20260129_2104'),
('game_dev', '0015_merge_20260131_1044'),
]

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class Migration(migrations.Migration):

dependencies = [
("game_dev", "0009_merge_20260131_1044"),
("game_dev", "0015_merge_20260131_1044"),
]

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class Migration(migrations.Migration):

dependencies = [
('game_dev', '0010_merge_20260131_1118'),
('game_dev', '0017_merge_20260131_1118'),
]

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
class Migration(migrations.Migration):

dependencies = [
("game_dev", "0010_merge_20260131_1118"),
("game_dev", "0010_socialmedia"),
("game_dev", "0017_merge_20260131_1118"),
("game_dev", "0018_socialmedia"),
]

operations = []
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
class Migration(migrations.Migration):

dependencies = [
("game_dev", "0010_game_itchgameembedid_game_itchgameheight_and_more"),
("game_dev", "0010_merge_20260131_1118"),
("game_dev", "0016_game_itchgameembedid_game_itchgameheight_and_more"),
("game_dev", "0017_merge_20260131_1118"),
]

operations = []
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
class Migration(migrations.Migration):

dependencies = [
("game_dev", "0011_alter_gameshowcase_game"),
("game_dev", "0011_merge_20260205_1434"),
("game_dev", "0019_alter_gameshowcase_game"),
("game_dev", "0021_merge_20260205_1434"),
]

operations = []
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class Migration(migrations.Migration):

dependencies = [
("game_dev", "0011_merge_0010_merge_20260131_1118_0010_socialmedia"),
("game_dev", "0020_merge_0010_merge_20260131_1118_0010_socialmedia"),
]

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class Migration(migrations.Migration):

dependencies = [
("game_dev", "0012_merge_20260214_1112"),
("game_dev", "0022_merge_20260214_1112"),
]

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
class Migration(migrations.Migration):

dependencies = [
('game_dev', '0011_alter_gameshowcase_game'),
('game_dev', '0012_remove_socialmedia_socialmedianame'),
('game_dev', '0019_alter_gameshowcase_game'),
('game_dev', '0023_remove_socialmedia_socialmedianame'),
]

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
class Migration(migrations.Migration):

dependencies = [
("game_dev", "0013_alter_game_itchgameembedid"),
("game_dev", "0013_merge_20260214_1347"),
("game_dev", "0024_alter_game_itchgameembedid"),
("game_dev", "0025_merge_20260214_1347"),
]

operations = []
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 5.1.15 on 2026-02-21 06:56

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("game_dev", "0026_merge_20260214_1420"),
]

operations = [
migrations.RemoveField(
model_name="game",
name="itchGameEmbedID",
),
migrations.AddField(
model_name="game",
name="itchGamePlayableID",
field=models.PositiveBigIntegerField(
blank=True,
default=None,
help_text="If a game is playable and has a web demo stored on itch.io, please enter the embed developer ID",
null=True,
),
),
]
11 changes: 5 additions & 6 deletions server/game_dev/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,11 @@ class CompletionStatus(models.IntegerChoices):
blank=True,
help_text="If game is stored on itch.io, please enter the itchEmbedID, i.e., 1000200"
)

thumbnail = models.ImageField(upload_to="games/", null=True)
event = models.ForeignKey(Event, on_delete=models.SET_NULL, null=True, blank=True)

itchGameEmbedID = models.PositiveBigIntegerField(
itchGamePlayableID = models.PositiveBigIntegerField(
default=None,
null=True,
blank=True,
help_text="If a game has a web demo stored on itch.io, please enter the embed ID"
help_text="If a game is playable and has a web demo stored on itch.io, please enter the embed developer ID"
)

itchGameWidth = models.PositiveBigIntegerField(
Expand All @@ -78,6 +74,9 @@ class CompletionStatus(models.IntegerChoices):
default=0
)

thumbnail = models.ImageField(upload_to="games/", null=True)
event = models.ForeignKey(Event, on_delete=models.SET_NULL, null=True, blank=True)

def __str__(self):
return str(self.name)

Expand Down
56 changes: 34 additions & 22 deletions server/game_dev/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,33 @@ def get_social_media(self, obj):

class GamesSerializer(serializers.ModelSerializer):
contributors = GameContributorSerializer(
many=True,
source="game_contributors",
read_only=True
many=True, source="game_contributors", read_only=True
)

class Meta:
model = Game
fields = ('id', 'name', 'description', 'completion', 'active', 'hostURL', 'itchEmbedID', 'thumbnail', 'event', 'itchGameEmbedID',
'itchGameWidth', 'itchGameHeight', "contributors")
fields = (
"id",
"name",
"description",
"completion",
"active",
"hostURL",
"itchEmbedID",
"thumbnail",
"event",
"itchGamePlayableID",
"itchGameWidth",
"itchGameHeight",
"contributors",
)


# Contributor serializer for name and role


class ShowcaseContributorSerializer(serializers.ModelSerializer):
name = serializers.CharField(source='member.name', read_only=True)
name = serializers.CharField(source="member.name", read_only=True)
role = serializers.CharField(read_only=True)
social_media = serializers.SerializerMethodField()

Expand All @@ -63,18 +75,24 @@ def get_social_media(self, obj):

# Serializer for GameShowcase
class GameshowcaseSerializer(serializers.ModelSerializer):
game_id = serializers.IntegerField(source='game.id', read_only=True)
game_name = serializers.CharField(source='game.name', read_only=True)
game_description = serializers.CharField(
source='game.description', read_only=True)
game_id = serializers.IntegerField(source="game.id", read_only=True)
game_name = serializers.CharField(source="game.name", read_only=True)
game_description = serializers.CharField(source="game.description", read_only=True)
game_cover_thumbnail = serializers.ImageField(
source='game.thumbnail', read_only=True)
source="game.thumbnail", read_only=True
)
contributors = serializers.SerializerMethodField()

class Meta:
model = GameShowcase
fields = ('game_id', 'game_name', 'game_description',
'description', 'contributors', 'game_cover_thumbnail')
fields = (
"game_id",
"game_name",
"game_description",
"description",
"contributors",
"game_cover_thumbnail",
)

def get_contributors(self, obj):
# Always fetch contributors from GameContributor for the related game
Expand All @@ -93,15 +111,9 @@ class Meta:

class MemberSerializer(serializers.ModelSerializer):
social_media = SocialMediaSerializer(
many=True, source="social_media_links", read_only=True)
many=True, source="social_media_links", read_only=True
)

class Meta:
model = Member
fields = [
"name",
"profile_picture",
"about",
"pronouns",
"social_media",
"pk"
]
fields = ["name", "profile_picture", "about", "pronouns", "social_media", "pk"]
Loading