-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add GameStat model to models.py - Add GameStatSerializer to serializers.py - Add GameStatViewSet to views.py - Update URLs to include GameStat endpoints - Modify existing tests in test_game_history.py to accommodate new GameStat model - Add tests for GameStat CRUD operations in test_game_history.py
- Loading branch information
Showing
5 changed files
with
201 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
# game_data/serializers.py | ||
|
||
from rest_framework import serializers | ||
from .models import GameHistory | ||
from .models import GameHistory, GameStat | ||
|
||
class GameHistorySerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = GameHistory | ||
fields = '__all__' | ||
class GameStatSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = GameStat | ||
fields = '__all__' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters