update models to decimal and account for null values

This commit is contained in:
nprasad2077 committed 2023-04-18 15:06:13 -05:00
1 parent 3de2377dd3
commit 1ca063cdcb
7 files changed
+374 -29

No files matched your search

+29 -27
View File
@@ -2,33 +2,35 @@ from django.db import models
# Create your models here.
class PlayerData(models.Model):
name = models.CharField(max_length=100)
age = models.CharField(max_length=100)
games = models.CharField(max_length=100)
games_started = models.CharField(max_length=100)
minutes_pg = models.CharField(max_length=100)
field_goals = models.CharField(max_length=100)
field_attempts = models.CharField(max_length=100)
field_percent = models.CharField(max_length=100)
three_fg = models.CharField(max_length=100)
three_attempts = models.CharField(max_length=100)
three_percent = models.CharField(max_length=100)
two_fg = models.CharField(max_length=100)
two_attempts = models.CharField(max_length=100)
two_percent = models.CharField(max_length=100)
effect_fg_percent = models.CharField(max_length=100)
ft = models.CharField(max_length=100)
fta = models.CharField(max_length=100)
ft_percent = models.CharField(max_length=100)
ORB= models.CharField(max_length=100)
DRB = models.CharField(max_length=100)
TRB = models.CharField(max_length=100)
AST = models.CharField(max_length=100)
STL = models.CharField(max_length=100)
BLK = models.CharField(max_length=100)
TOV = models.CharField(max_length=100)
PF = models.CharField(max_length=100)
PTS = models.CharField(max_length=100)
name = models.CharField(max_length=255, null=True)
age = models.IntegerField(null=True)
games = models.IntegerField(null=True)
games_started = models.IntegerField(null=True)
minutes_pg = models.DecimalField(max_digits=5, decimal_places=2, null=True)
field_goals = models.DecimalField(max_digits=5, decimal_places=2, null=True)
field_attempts = models.DecimalField(max_digits=5, decimal_places=2, null=True)
field_percent = models.DecimalField(max_digits=5, decimal_places=3, null=True)
three_fg = models.DecimalField(max_digits=5, decimal_places=2, null=True)
three_attempts = models.DecimalField(max_digits=5, decimal_places=2, null=True)
three_percent = models.DecimalField(max_digits=5, decimal_places=3, null=True)
two_fg = models.DecimalField(max_digits=5, decimal_places=2, null=True)
two_attempts = models.DecimalField(max_digits=5, decimal_places=2, null=True)
two_percent = models.DecimalField(max_digits=5, decimal_places=3, null=True)
effect_fg_percent = models.DecimalField(max_digits=5, decimal_places=3, null=True)
ft = models.DecimalField(max_digits=5, decimal_places=2, null=True)
fta = models.DecimalField(max_digits=5, decimal_places=2, null=True)
ft_percent = models.DecimalField(max_digits=5, decimal_places=3, null=True)
ORB= models.DecimalField(max_digits=5, decimal_places=2, null=True)
DRB = models.DecimalField(max_digits=5, decimal_places=2, null=True)
TRB = models.DecimalField(max_digits=5, decimal_places=2, null=True)
AST = models.DecimalField(max_digits=5, decimal_places=2, null=True)
STL = models.DecimalField(max_digits=5, decimal_places=2, null=True)
BLK = models.DecimalField(max_digits=5, decimal_places=2, null=True)
TOV = models.DecimalField(max_digits=5, decimal_places=2, null=True)
PF = models.DecimalField(max_digits=5, decimal_places=2, null=True)
PTS = models.DecimalField(max_digits=5, decimal_places=2, null=True)
team = models.CharField(max_length=30, default='')
season = models.IntegerField(null=True)
def __str__(self):
return self.name