Django.db.utils.DataError:类型字符变化的值太长(3)

时间:2017-11-09 19:51:43

标签: python django models

我不知道为什么我收到此错误,因为我的字段都没有设置为限制3除了一个,我知道永远不会超过3.我能够运行python manage.py makemigrations没有任何问题,但一次我migrate弹出错误。我的模型看起来像这样:

class Player(models.Model):
  player_id = models.PositiveIntegerField()
  player_name = models.CharField(max_length=60)
  team_id = models.PositiveIntegerField()
  team_abbreviation = models.CharField(max_length=3)
  age = models.PositiveIntegerField()
  gp = models.PositiveIntegerField()
  w = models.PositiveIntegerField()
  l = models.PositiveIntegerField()
  w_pct = models.DecimalField(max_digits=4, decimal_places=3)
  min = models.DecimalField(max_digits=4, decimal_places=3)
  fgm = models.DecimalField(max_digits=4, decimal_places=3)
  fga = models.DecimalField(max_digits=4, decimal_places=3)
  fg_pct = models.DecimalField(max_digits=4, decimal_places=3)
  fg3m = models.DecimalField(max_digits=4, decimal_places=3)
  fg3a = models.DecimalField(max_digits=4, decimal_places=3)
  fg3_pct = models.DecimalField(max_digits=4, decimal_places=3)
  ftm = models.DecimalField(max_digits=4, decimal_places=3)
  fta = models.DecimalField(max_digits=4, decimal_places=3)
  ft_pct = models.DecimalField(max_digits=4, decimal_places=3)
  oreb = models.DecimalField(max_digits=4, decimal_places=3)
  dreb = models.DecimalField(max_digits=4, decimal_places=3)
  reb = models.DecimalField(max_digits=4, decimal_places=3)
  ast = models.DecimalField(max_digits=4, decimal_places=3)
  tov = models.DecimalField(max_digits=4, decimal_places=3)
  stl = models.DecimalField(max_digits=4, decimal_places=3)
  blk = models.DecimalField(max_digits=4, decimal_places=3)
  blka = models.DecimalField(max_digits=4, decimal_places=3)
  pf = models.DecimalField(max_digits=4, decimal_places=3)
  pfd = models.DecimalField(max_digits=4, decimal_places=3)
  pts = models.DecimalField(max_digits=4, decimal_places=3)
  plus_minus = models.DecimalField(max_digits=4, decimal_places=3)
  nba_fantasy_pts = models.DecimalField(max_digits=4, decimal_places=3)
  dd2 = models.DecimalField(max_digits=4, decimal_places=3)
  td3 = models.DecimalField(max_digits=4, decimal_places=3)
  gp_rank = models.PositiveIntegerField()
  w_rank = models.PositiveIntegerField()
  l_rank = models.PositiveIntegerField()
  w_pct_rank = models.PositiveIntegerField()
  min_rank = models.PositiveIntegerField()
  fgm_rank = models.PositiveIntegerField()
  fga_rank = models.PositiveIntegerField()
  fg_pct_rank = models.PositiveIntegerField()
  fg3m_rank = models.PositiveIntegerField()
  fg3a_rank = models.PositiveIntegerField()
  fg3_pct_rank = models.PositiveIntegerField()
  ftm_rank = models.PositiveIntegerField()
  fta_rank = models.PositiveIntegerField()
  ft_pct_rank = models.PositiveIntegerField()
  oreb_rank = models.PositiveIntegerField()
  dreb_rank = models.PositiveIntegerField()
  reb_rank = models.PositiveIntegerField()
  ast_rank = models.PositiveIntegerField()
  tov_rank = models.PositiveIntegerField()
  stl_rank = models.PositiveIntegerField()
  blk_rank = models.PositiveIntegerField()
  blka_rank = models.PositiveIntegerField()
  pf_rank = models.PositiveIntegerField()
  pfd_rank = models.PositiveIntegerField()
  pts_rank = models.PositiveIntegerField()
  plus_minus_rank = models.PositiveIntegerField()
  nba_fantasy_pts_rank = models.PositiveIntegerField()
  dd2_rank = models.PositiveIntegerField()
  td3_rank = models.PositiveIntegerField()
  cfid = models.PositiveIntegerField()
  cfparams = models.CharField(max_length=18)

我对Python很陌生,所以也许这是我之前从未见过的简单但我没有找到能够提供帮助的答案。这里是 stack trace

0 个答案:

没有答案