context_data = {"form":List.objects.get(id=pk)}
If I modify that line as below taking in the model’s name,
context_data = {"List":List.objects.get(id=pk)}
then I am getting error as below,
Failed lookup for key [form] in [{'True': True, 'False': False, 'None': None}, {}, {}, {'List': <List: 8008>}]
Could you please let me know what is the exact way to display the selected record’s detail in the same form as that of one used with Create? - Thank you!
You missed the point of the previous response.
Your template is expecting to find a key in the context named “form”.
In DView, you’re not setting the context key “form” to an instance of a form. You’re setting it to an instance of List
.
Changing the key name in your context from “form” to “List” doesn’t fix that. (You’ve changed it from setting “form” to being of the wrong data type to not setting it at all.)
When I reference something called the context
, what am I talking about? (What is a context
?)
What is a Django form
?
When I talk about something being an instance of List
, what does this mean?
(I need to know where to start an explanation)
Will I do everything I can to help you learn what you need to know, to be able to move forward past this point? Absolutely.
But for me to help you move forward, I need to understand what your level of knowledge is now.