一. 问题描述

(1)python django代码中的model,整数这种字段,如果后面跟着(max_length=10)

python django 报错 an invalid keyword argument for this function

         则有警告信息如下:

          (fields.W122) 'max_length' is ignored when used with IntegerField
          HINT: Remove 'max_length' from field

(2)如果删除,则报错:

          'unum' is an invalid keyword argument for this function"

 

二.解决方案:

字段后面,还是添加上 (max_length=10)  这种后缀,忽略警告信息 

 

 

 

 

 

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-08
  • 2021-07-23
  • 2021-09-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-31
  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
  • 2021-08-16
相关资源
相似解决方案