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
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
"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
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
> 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})
--~--~-~--~~~---~--
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
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
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
8 matches
Mail list logo