Re: How to pass pk through URL to CreateView

2020-02-18 Thread Sam Hefer
Hi Phil, I did find a solution to my query. Have a look at my post on stackoverflow: https://stackoverflow.com/a/60273100/7063031 Thanks, Sam > On 19/02/2020, at 3:21 AM, Phil Kauffman wrote: > >  > Hello, > > Did you get any headway on this issue? I'm a novice Django user but was > thin

Re: How to pass pk through URL to CreateView

2020-02-18 Thread Farai M
It should work two issue 1.Url is not matching your need to visit that is where you are getting that reverse error. 2.To pull that value through kwargs you need to use the get request so override the get method otherwise it should work fine. On Sat, Feb 15, 2020, 5:19 AM Sam Hefer wrote: > Hi, >

Re: How to pass pk through URL to CreateView

2020-02-18 Thread Phil Kauffman
Hello, Did you get any headway on this issue? I'm a novice Django user but was thinking of doing something similar with my code for a project I'm working on. I'm struggling with reverse lookup on foreign key. Have you had any issues doing reverse lookup on FK? For example in a view if you wan

How to pass pk through URL to CreateView

2020-02-14 Thread Sam Hefer
Hi, I'm trying to figure out how to fill a form field in the background using form_valid. However, everything I've tried doesn't work. As you can see in the model, there is a job field with a foreign key to Job. class JobDocket(models.Model): EQUIPMENT_TYPE = ( ('1', 'Air Conditio