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
<
I faced this issue and I figured out that I made records in the DB table that in your case is (Quote) before making the foreign key relationship with (Author) then after making the foreign key relationship Django doesn't know what to do to handle the old data in Quote model (to which records in Author should old records be assigned to)
--> The simplest solution is to:
delete your old Quote records: Quote.objects.all().delete
inside your shell
recreate and reassign its new records correctly
makemigrations, migrate and runserver ... done