It puzzled me. (But I'm new to this.) The general view of object_detail is called with the request and the identifier field. When object_detail then displays the template, this is done with the name template_object_name. When I write a template, I use template_object_name and can display all fields. Ok, thatβs good, but I have a form that I created with ModelForm.
So how do I get the form? I looked around. I tried passing the form to extra_context so that the form can receive data in the object that is used to render the template, but not go.
The workaround is just a view entry. The problem with object_detail is that the SQL that pulls the string at the specified id is executed inside object_detail, and then the object jumps to the view. If I'm interested in using the form I created with ModelForm, then I want to set the form = mymodelForm (object) and pass the form to the template for rendering. Another way to ask the question is: where is the hook_ object, indicating which object is listed?
source share