SOLVED !!!
okay I've fonnaly get it !! :)... . .
so you should pass to the kid template the form and its value (the
preset field) like
----- controllers.py
class Root(controllers.RootController):
@expose(html="turbobs.templates.test", allow_json=True)
def test(self):
class CommentFields(widgets.WidgetsList):
"""The WidgetsList defines the fields of the form."""
name = widgets.TextField(validator=validators.NotEmpty())
email = widgets.TextField(
validator=validators.Email(not_empty=True),
attrs={'size':30} )
comment = widgets.TextArea(validator=validators.NotEmpty())
notify = widgets.CheckBox(label="Notify me")
comment_form = widgets.TableForm(fields=CommentFields()
,action="save" )
data = dict(name='Joe', comment='Hello World', notify=True )
return dict(form=comment_form, form_value=data)
-----
and the template associated with it
----- test.kid
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://purl.org/kid/ns#"
py:extends="'master.kid'">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type"
py:replace="''"/>
<title>Welcome to TurboGears</title>
</head>
<body>
<p py:content="form(value=form_value)">add people form</p>
</body>
</html>
-----
Ced.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---