Re: How to bind data to a form, and not make the validation fire

2008-01-07 Thread Alex Koshelev
It depends on concrete design decisions. Form wide initial data have higher priority then the field's initial data. But if I don't want init some field every time at form instance creation time I can pass callable object to field declaration. On 7 янв, 12:59, Collin Grady <[EMAIL PROTECTED]> wrot

Re: How to bind data to a form, and not make the validation fire

2008-01-07 Thread Collin Grady
It doesn't have to be a callable, you just need to use the FORM's initial arg, as Malcolm was initially referring to, not the field's initial argument. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gr

Re: How to bind data to a form, and not make the validation fire

2008-01-06 Thread Alex Koshelev
"Initial" parameter can be a callable object. So you can create "lazy getter" for your initial data On 6 янв, 19:27, shabda <[EMAIL PROTECTED]> wrote: > But I need the initial data to be dynamic, so I can't just do > text = forms.CharField(widget = forms.Textarea, initial = 'sometext') > > I assu

Re: How to bind data to a form, and not make the validation fire

2008-01-06 Thread shabda
But I need the initial data to be dynamic, so I can't just do text = forms.CharField(widget = forms.Textarea, initial = 'sometext') I assume I can do some thing along the lines of overriding __init__ for this form, passing the requored value from the view function and then using something like te

Re: How to bind data to a form, and not make the validation fire

2008-01-06 Thread Doug B
> But I need the initial data to be dynamic, so I can't just do > text = forms.CharField(widget = forms.Textarea, initial = 'sometext') A form also has an initial argument. form=YourForm(initial={'formfield1': formvalue1,'formfield2':formvalue2}) --~--~-~--~~~---~--

Re: How to bind data to a form, and not make the validation fire

2008-01-06 Thread Todd O'Bryan
On Jan 6, 2008 11:27 AM, shabda <[EMAIL PROTECTED]> wrote: > > But I need the initial data to be dynamic, so I can't just do > text = forms.CharField(widget = forms.Textarea, initial = 'sometext') > > I assume I can do some thing along the lines of overriding __init__ > for this form, passing the

Re: How to bind data to a form, and not make the validation fire

2008-01-06 Thread Malcolm Tredinnick
On Sun, 2008-01-06 at 01:32 -0800, shabda wrote: > I have a form, to which I want to pass some data when it is first > dipalyed, > My form is, > class EditPage(forms.Form): > text = forms.CharField(widget = forms.Textarea) > edit_summary = forms.CharField() > > In my view I bind data to

How to bind data to a form, and not make the validation fire

2008-01-06 Thread shabda
I have a form, to which I want to pass some data when it is first dipalyed, My form is, class EditPage(forms.Form): text = forms.CharField(widget = forms.Textarea) edit_summary = forms.CharField() In my view I bind data to this form as if request.method == 'GET': page = Page.o