Re: Redirect after Form

2016-10-31 Thread Moreplavec
Many thanks, works fine and looks much better to me. Dne pondělí 31. října 2016 10:21:37 UTC+1 Michal Petrucha napsal(a): > > On Sun, Oct 30, 2016 at 06:39:19AM -0700, Moreplavec wrote: > > I found in Django Tutorial solution: > > https://docs.djangoproject.com/en/1.10/intro/tutorial04/ : > >

Re: Redirect after Form

2016-10-31 Thread Michal Petrucha
On Sun, Oct 30, 2016 at 06:39:19AM -0700, Moreplavec wrote: > I found in Django Tutorial solution: > https://docs.djangoproject.com/en/1.10/intro/tutorial04/ : > > Now i have: > > return HttpResponseRedirect(reverse('crm:company_detail', args=(company.pk,))) > #return redirect('views.company_de

Re: Redirect after Form

2016-10-30 Thread Moreplavec
I found in Django Tutorial solution: https://docs.djangoproject.com/en/1.10/intro/tutorial04/ : Now i have: return HttpResponseRedirect(reverse('crm:company_detail', args=(company.pk,))) #return redirect('views.company_detail', pk=company.pk) And it works fine! -- You received this message

Redirect after Form

2016-10-30 Thread Stanislav Vasko
Greetings, trying to create new app with simple Form to create and update Company info. My view looks like: def company_new(request): if request.method == "POST": form = CompanyForm(request.POST) if form.is_valid(): company = form.save(commit=False) co