Django: invalid literal for int() with base 10

后端 未结 6 763
时光说笑
时光说笑 2020-12-15 03:14

I am new to Django and trying to pass an author\'s name to a view and filter out quote objects based on the author\'s name. here are the codes:

models.py

<         


        
6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-15 03:37

    This will fix your problem permanently ::go to your directory

    C:\python 37\Lib\site-packages\django\db\models\fields 
    

    and edit the file __init__.py and edit line 1807; replace

    return int(value)
    

    with

    return int()
    

    So just delete the argument value then your program will except all field references.

提交回复
热议问题