mirror of
https://github.com/nprasad2077/nbaStats.git
synced 2026-11-13 13:23:46 +00:00
shot chart data is being served up
This commit is contained in:
1 parent
1c54ed2627
commit
6026b51567
4 files changed
+19
-7
No files matched your search
@@ -37,8 +37,13 @@ class PlayerSalaryDataSerializer(serializers.ModelSerializer):
|
||||
fields = '__all__'
|
||||
|
||||
class PlayerShotChartDataSerializer(serializers.ModelSerializer):
|
||||
color = serializers.SerializerMethodField()
|
||||
|
||||
class Meta:
|
||||
model = PlayerShotChartData
|
||||
fields = '__all__'
|
||||
fields = ['top', 'left', 'date', 'qtr', 'time_remaining', 'result', 'shot_type', 'distance_ft', 'lead', 'lebron_team_score', 'opponent_team_score', 'opponent', 'team', 'season', 'color']
|
||||
|
||||
def get_color(self, obj):
|
||||
return 'green' if obj.result else 'red'
|
||||
|
||||
|
||||
Reference in new issue
Block a user