2👍
Solved the issue. This has been a bug in code.Django
under ticket #23454
https://code.djangoproject.com/ticket/23454
But this bug has been closed due to insufficient information.
I created a new app and replaced the files with the older one and makemigrations
as well as migrate
ran successfully.
I think this issue arises if we try to change the Django Auth system after first migrate.
Thanks
0👍
What this means ?
Your function get_prep_value
is returning this
return int(value) -> Type of value is User object
But it should be of type int or string(only if its a valid integer
enclosed in double quotes like “1” else an exception would be raised)
Since you have not shared that function, i would suggest the following things
- Check what you are passing into the value.
- Use
type (value)
before your return statement so you know what you are having inside the value variable.
Read here about the int() which might be confusing you here
- [Answered ]-Form wizard with ModelForms having parameters in __init__
- [Answered ]-Django REST API custom methods for generic views
- [Answered ]-Adding more associations with foreign key
- [Answered ]-Django select_related works in template rendering?
- [Answered ]-How to define a view function in views.py file in django
Source:stackexchange.com