3π
β
The option default='company'
in Client
, Leads
and CallReport
must be the error, make sure to remove it and then run the following commands:
python manange.py makemigrations
And after that run the following:
python manage.py migrate
When you define a relationship in django models, you can not add a type string in a relationship that is pointing to another model.
π€allexiusw
0π
"A ForeignKey contains the primary key of the target table. If the primary key of that table relating to the company value is an integer, then your default value must be that integer", not that string
then, Remember to delete the database, and the migrations inside the migrations folder, and Then
python manange.py makemigrations
Run the following:
python manage.py migrate
This should resolve your issue.
π€barna
- [Django]-How do I test Django views when they don't return values
- [Django]-How to create a custom 404 page for my Django/Apache?
- [Django]-Access to fields of prefetch_related on reverse relation
- [Django]-Django: check a last character in string
- [Django]-TypeError: __init__() got an unexpected keyword argument 'decimal_places'
Source:stackexchange.com