its constructor. You shoul use this because parent constructor should be save
thanks, Serge
(or Sergio for you :-) )
2012/7/10 Leandro Alves :
> Hi Сергей Ф,
>
> It worked now!!! \o/
>
> But I have a question... in this case why do I need to send "None" in
>
Read and understood!! :)
Thanks, Kenneth!!
Leandro
On Tuesday, July 10, 2012 3:00:34 PM UTC+2, lawgon wrote:
>
> On Tue, 2012-07-10 at 05:56 -0700, Leandro Alves wrote:
> > But I have a question... in this case why do I need to send "None" in
> > "get_form_kwargs"
>
> None is the default
On Tue, 2012-07-10 at 05:56 -0700, Leandro Alves wrote:
> But I have a question... in this case why do I need to send "None" in
> "get_form_kwargs"
None is the default value to prevent a crash
> and why should I use the "super(ContactForm2, self).__init__(*args,
> **kwargs)" after the init?
Hi skhohlov,
I will read it right now
Thanks for sharing.
Leandro
On Tuesday, July 10, 2012 2:09:59 PM UTC+2, skhohlov wrote:
>
> Sometimes ago I've added a post to my blog about this:
>
> http://skhohlov.blogspot.com/2012/04/passing-values-from-view-to-form.html
>
> 2012/7/10 Сергей
Hi Сергей Ф,
It worked now!!! \o/
But I have a question... in this case why do I need to send "None" in "
get_form_kwargs" and why should I use the "super(ContactForm2,
self).__init__(*args, **kwargs)" after the init?
Thank you very much for your help!!
Leandro
*
*
On Tuesday, July 10,
Sometimes ago I've added a post to my blog about this:
http://skhohlov.blogspot.com/2012/04/passing-values-from-view-to-form.html
2012/7/10 Сергей Фурсов :
> You can try to override get_form_kwargs method
>
> def get_form_kwargs(self, step):
> if step == '1'
>
You can try to override get_form_kwargs method
def get_form_kwargs(self, step):
if step == '1'
cleaned_data = self.get_cleaned_data_for_step('0') or {}
return {'sender': cleaned_data.get('sender', None)}
else:
return {}
and in ContactForm2 override __init__ method
Hi,
Yes... it is exactly with the form wizard that I'm trying to do it..
But how can I "receive" these values inside my forms.py? This is what I
couldn't find yet.
I want to be able use this values inside the ContactForm2 form.
Thanks for your help so far.
Leandro
On Tuesday, July 10,
Why not use Form Wizard from django.contrib.formtools.
Look at
https://docs.djangoproject.com/en/dev/ref/contrib/formtools/form-wizard/#conditionally-view-skip-specific-steps
Simply change show_message_form_condition method to something like
def show_message_form_condition(wizard):
9 matches
Mail list logo