passing a parameter through CreateView to a be an initial value in a form

2020-02-19 Thread Sam Hefer
Hey Patric, Have a look at stackoverflow. https://stackoverflow.com/a/60273100/7063031 I used form_valid in the createview to get the form instance field, passed the pk through the URL to the template, then used get_context in the view so the template can get the pk from the URL. You’ll unde

passing a parameter through CreateView to a be an initial value in a form

2020-02-19 Thread Patrick Carra
Hello I am trying to pass a value from a link into CreateView and use that value as an inital value in a form. I am not having much success and am not sure that I am doing this correctly. Here is what I have so far: Link: Circuit Ref: {{ record.id1 }} urls.py path('addXC//', views.addXC.as_vie