Question: I have a problem in my code that maybe someone can check and point out the problem. I'm creating two webpages in php and I'm requesting variables from one page to another. As you see in the photo in my first page I have a drop list of values I successfully grab from a database. In the second page I want to print a list of matching items which are boats based on the choice the user select from the first page. Now from there I creating a sql query to first check that the user is not selected 'All' or not mixing 'All' with the provided choices. If either is not the case then the database field name is equal to the requested item and echo that to the screen. In second page I have successfully connected to the database. The problem is when testing my code, the screen is blank which means, my string is faulty. Thanks in advance. Here is my code

Answer: 
You can't use `kwargs` in `success_url`, because when Django loads the class when the server starts, it doesn't have access to the request. Override the `get_success_url` method instead. 

```
def get_success_url(self) 
    return reverse('employee-details', kwargs={'pk': self.kwargs['pk']})

```
Alasdair's answer solves your problem. You can however define a `get_absolute_url` method for your `EmployeePersonal` model which will act as the `success_url` for your view: 

> 
> You don’t even need to provide a `success_url` for `CreateView` or
>  `UpdateView` - they will use `get_absolute_url()` on the model object
>  if available.
> 
> 
> 

You'll use `self.id` in the `get_absolute_url` method for the model objects primary key.

---

Reference:

[Model Forms](https://docs.djangoproject.com/en/1.10/topics/class-based-views/generic-editing/#model-forms)