Thanks works perfect Alessandro.



El lunes, 24 de marzo de 2014 12:43:29 UTC-6, Alessandro Molina escribió:
>
> MovieForm.display(value={'channel': 'google'}) is what you are looking for.
> It's described at Displaying Forms documentation: 
> http://turbogears.readthedocs.org/en/latest/cookbook/TwForms.html#displaying-forms
>
>
> On Sat, Mar 22, 2014 at 12:41 AM, Antonio Fregoso 
> <[email protected]<javascript:>
> > wrote:
>
>>
>> Hi all
>>
>> I want to assign value at runtime in a HiddenField Turbogear 2.3.2
>>
>>
>> The form
>>
>> class MovieForm(twf.Form):
>>     class child(twf.TableLayout):
>>         title = twf.TextField(validator=twc.Required)
>>         director = twf.TextField(value='Default Director', 
>> validator=twc.Required)
>>         director_verify = twf.TextField()
>>         genres = twf.CheckBoxList(options=['Action', 'Comedy', 'Romance', 
>> 'Sci-fi'])
>>         channel=twf.HiddenField(value='putos')
>>     action = lurl('/save_movie')
>>     validator = FieldsMatch('director', 'director_verify')
>>
>>
>> The controller
>>
>> @expose('pruebas.templates.demo')
>>     def demo(self, *args, **kw):
>>         myform = MovieForm
>>         myform.child.channel(value='google')
>>         return dict(page='demo', form=myform)
>>
>> The error
>>
>> myform.child.channel(value='google')
>> AttributeError: type object 'child_s' has no attribute 'channel'
>>
>>
>>
>> Thanks for your help
>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "TurboGears" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/turbogears.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.

Reply via email to