Re: Two forms in one template

2021-02-04 Thread Sergei Sokov
Thank you so mach! четверг, 4 февраля 2021 г. в 14:13:24 UTC-1, wne...@gmail.com: > https://riptutorial.com/django/example/16667/one-view--multiple-forms > https://pylab.ru/django-dve-formy-v-odnom-view/ > > > четверг, 4 февраля 2021 г. в 16:44:54 UTC+3, soko...@gmail.com: > >> Hi, I have same

Re: Two forms in one template

2021-02-04 Thread Siarhei Siarhei
https://riptutorial.com/django/example/16667/one-view--multiple-forms https://pylab.ru/django-dve-formy-v-odnom-view/ четверг, 4 февраля 2021 г. в 16:44:54 UTC+3, soko...@gmail.com: > Hi, I have same problem. > I am doing same like did you but it doesnt work. POST doesnt work. > Could you pleas

Re: Two forms in one template

2021-02-04 Thread Sergei Sokov
Hi, I have same problem. I am doing same like did you but it doesnt work. POST doesnt work. Could you please hrlp me with it? среда, 6 мая 2020 г. в 12:47:00 UTC-1, adigun...@gmail.com: > You are welcome. > > I'm happy to help > -- You received this message because you are subscribed to the Go

Re: Two forms in one template

2020-05-06 Thread Sherif Adigun
You are welcome. I'm happy to help -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web

Re: Two forms in one template

2020-05-06 Thread Sergei Sokov
Thank you very much!! You are best!!! среда, 6 мая 2020 г., 15:09:39 UTC+2 пользователь Sherif Adigun написал: > > https://us04web.zoom.us/j/79500561313?pwd=TnIzekVTMU0xRDNsaGpaS0kxQlhTdz09 > > > JOIN NOW > -- You received this message because you are subscribed to the Google Groups "Django

Re: Two forms in one template

2020-05-06 Thread Sherif Adigun
https://us04web.zoom.us/j/79500561313?pwd=TnIzekVTMU0xRDNsaGpaS0kxQlhTdz09 JOIN NOW -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@go

Re: Two forms in one template

2020-05-06 Thread Sergei Sokov
I am ready среда, 6 мая 2020 г., 12:35:28 UTC+2 пользователь Sherif Adigun написал: > > ok. send a reply when you are available. > > On Wed, May 6, 2020 at 11:13 AM Sergei Sokov > wrote: > >> I can a little bit later, ok? >> I think in 2 hour >> >> среда, 6 мая 2020 г., 12:00:13 UTC+2 пользовател

Re: Two forms in one template

2020-05-06 Thread Sherif Adigun
ok. send a reply when you are available. On Wed, May 6, 2020 at 11:13 AM Sergei Sokov wrote: > I can a little bit later, ok? > I think in 2 hour > > среда, 6 мая 2020 г., 12:00:13 UTC+2 пользователь Sherif Adigun написал: >> >> Please join the meeting now let's quickly fix it . >> >> https://us0

Re: Two forms in one template

2020-05-06 Thread Sergei Sokov
I can a little bit later, ok? I think in 2 hour среда, 6 мая 2020 г., 12:00:13 UTC+2 пользователь Sherif Adigun написал: > > Please join the meeting now let's quickly fix it . > > https://us04web.zoom.us/j/77729655336?pwd=c1o2Q0JQOFJiYm5hTlJTYjgra0dOQT09 > > On Monday, May 4, 2020 at 4:37:39 PM UT

Re: Two forms in one template

2020-05-06 Thread Sherif Adigun
Please join the meeting now let's quickly fix it . https://us04web.zoom.us/j/77729655336?pwd=c1o2Q0JQOFJiYm5hTlJTYjgra0dOQT09 On Monday, May 4, 2020 at 4:37:39 PM UTC+1, Sergei Sokov wrote: > > I have two forms in one template, but one of them doesn't have data to my > database. > Why does it h

Re: Two forms in one template

2020-05-06 Thread Sergei Sokov
my zoom Sergey Sokov среда, 6 мая 2020 г., 10:37:42 UTC+2 пользователь Sergei Sokov написал: > > I can but my english is very bad. > > среда, 6 мая 2020 г., 10:08:47 UTC+2 пользователь Sherif Adigun написал: >> >> Can you come to zoom so we fix this ones and for all >> >> On Wed, May 6, 2020, 8:13

Re: Two forms in one template

2020-05-06 Thread Sergei Sokov
I can but my english is very bad. среда, 6 мая 2020 г., 10:08:47 UTC+2 пользователь Sherif Adigun написал: > > Can you come to zoom so we fix this ones and for all > > On Wed, May 6, 2020, 8:13 AM Sergei Sokov > > wrote: > >> [image: kwargs.JPG] >> But the form is empty. >> >> class SkladCreateVi

Re: Two forms in one template

2020-05-06 Thread Sherif Adigun
Can you come to zoom so we fix this ones and for all On Wed, May 6, 2020, 8:13 AM Sergei Sokov wrote: > [image: kwargs.JPG] > But the form is empty. > > class SkladCreateView(LoginRequiredMixin, CustomSuccessMessageMixin, > CreateView): > model = Sklad > template_name = 'sklad.html' >

Re: Two forms in one template

2020-05-06 Thread Sergei Sokov
[image: kwargs.JPG] But the form is empty. class SkladCreateView(LoginRequiredMixin, CustomSuccessMessageMixin, CreateView): model = Sklad template_name = 'sklad.html' form_class = SkladForm success_url = reverse_lazy('sklad') success_msg = 'Материал сохранён' def get_co

Re: Two forms in one template

2020-05-05 Thread Sherif Adigun
Please remove if pack_form.is_valid(): pack_form.instance = self.object pack_form.save() And replace with print(pack_form) Then let's see what it's printing in the console On Tue, May 5, 2020, 8:30 PM Sergei Sokov wrote: > I have this error when I try save data for

Re: Two forms in one template

2020-05-05 Thread Sergei Sokov
I have this error when I try save data for SkladForm, when I press submit Request Method: POST Request URL: http://192.168.0.249:8000/sklad Django Version: 3.0.5 Exception Type: KeyError Exception Value: 'pack_form' Exception Location: /var/workspace/myp4/webprint/print/views.py in form_valid,

Re: Two forms in one template

2020-05-05 Thread Sherif Adigun
> > you have two returns in get_Context_data. use only this > def get_context_data(self, **kwargs): context = super(SkladCreateView, self).get_context_data(**kwargs) if self.request.POST: context['pack_form'] = PackForm(self.request.POST) else: con

Re: Two forms in one template

2020-05-05 Thread Sergei Sokov
Thank you for answer. I have this error when I try save data for SkladForm, when I press submit Request Method: POST Request URL: http://192.168.0.249:8000/sklad Django Version: 3.0.5 Exception Type: KeyError Exception Value: 'pack_form' Exception Location: /var/workspace/myp4/webprint/print/vie

Re: Two forms in one template

2020-05-05 Thread Sherif Adigun
Try this code. Instead of using kwargs[], context is most common. class SkladCreateView(LoginRequiredMixin, CustomSuccessMessageMixin, CreateView): model = Sklad template_name = 'sklad.html' form_class = SkladForm success_url = reverse_lazy('sklad') success_msg = 'Материал сохранён' def g

Re: Two forms in one template

2020-05-04 Thread Sergei Sokov
I guessed about it. But I dont know how to do that. понедельник, 4 мая 2020 г., 18:42:10 UTC+2 пользователь Sherif Adigun написал: > > Your code is working perfectly. Just that you need to remember that the > view has its model set to Sklad. Hence, when you called super() on > form_valid, only

Re: Two forms in one template.

2017-11-15 Thread Mike Ru
Thank you so much! среда, 15 ноября 2017 г., 6:29:57 UTC+3 пользователь Mike Ru написал: > > How can I pass two forms(registration and login) in one template? I'm > using 'registration' and it's using different templates. For registration > it's using 'registration_form.html and for login it's u

Re: Two forms in one template.

2017-11-15 Thread Ege Güneş
You need to render your template with two forms in context. For example: class LoginFormView(views.View): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context["login_form"] = LoginForm() context["registration_form"] = RegistrationFo