Skip to content
Advertisement

Django Error: ValueError: Field ‘id’ expected a number but got ‘Нет’

I was adding a new model, but had the error ValueError: Field 'id' expected a number but got 'Нет'. After that I deleted a new model, but error don’t disappear. I tried to change models.py, admin.py, form.py and I even deleted fully models.py, but it didn’t change anything. models.py without choices

JavaScript

I can’t makemigrations. Full error:

JavaScript

Choices that contains the election with “Нет”:

JavaScript

Advertisement

Answer

Can you share your migrations so can see it more clearly? Because there is no problem with your model. Maybe the type of a value set as default in your previous migrations does not match the field.

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement