Re: cleaned_data in forms.py?

2012-07-10 Thread Sergiy Khohlov
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 >

Re: cleaned_data in forms.py?

2012-07-10 Thread Leandro Alves
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

Re: cleaned_data in forms.py?

2012-07-10 Thread kenneth gonsalves
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?

Re: cleaned_data in forms.py?

2012-07-10 Thread Leandro Alves
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 Сергей

Re: cleaned_data in forms.py?

2012-07-10 Thread Leandro Alves
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,

Re: cleaned_data in forms.py?

2012-07-10 Thread Sergiy Khohlov
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' >

Re: cleaned_data in forms.py?

2012-07-10 Thread Сергей Фурсов
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

Re: cleaned_data in forms.py?

2012-07-10 Thread Leandro Alves
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,

Re: cleaned_data in forms.py?

2012-07-10 Thread Сергей Фурсов
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):