as I followed the tutouial on TG.org,however, there is not the expect
result:
welcome.kid:
...
the "turbogears" channel on irc.freenode.org!</p>
<p>%{form.display(user)}</p>
</body>
</html>
controllers.py:
import logging
import cherrypy
import turbogears
from turbogears import controllers, expose, validate, redirect
from wiki import json
from turbogears.widgets import DataGrid
log = logging.getLogger("wiki.controllers")
users_admin_form = DataGrid(fields=[
('ID', 'userId'),
('Name', 'displayName'),
('E-mail', 'emailAddress'),
])
class User:
def __init__(self, ID, name, emailAddress):
self.userId = ID
self.name = name
self.emailAddress = emailAddress
displayName = property(fget=lambda self: self.name.capitalize())
class Root(controllers.RootController):
@expose(template="wiki.templates.welcome")
def index(self):
log.debug("Happy TurboGears Controller Responding For Duty")
users = [User(1, 'john', '[EMAIL PROTECTED]'), User(2, 'fred',
'[EMAIL PROTECTED]')]
return dict(form=users_admin_form,user=users)
what have I done wrong?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---