Use get parameters as initial form values (#3)
This commit is contained in:
parent
34d5ce647c
commit
4e6dd25c99
1 changed files with 4 additions and 1 deletions
|
@ -41,7 +41,10 @@ class UserMixin(LoginRequiredMixin):
|
||||||
|
|
||||||
class UserFormMixin:
|
class UserFormMixin:
|
||||||
def get_form_kwargs(self):
|
def get_form_kwargs(self):
|
||||||
return super().get_form_kwargs() | {"user": self.request.user}
|
return super().get_form_kwargs() | {
|
||||||
|
"user": self.request.user,
|
||||||
|
"initial": self.request.GET,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class NummiCreateView(UserMixin, UserFormMixin, CreateView):
|
class NummiCreateView(UserMixin, UserFormMixin, CreateView):
|
||||||
|
|
Loading…
Reference in a new issue