Hello,

while trying to to make a simple datagrid following the docs, I always
get the error:

AssertionError: Method Root.dg() returned unexpected output. Output
should be of type basestring, dict or generator.

Here is my code (using today's svn version):

.....
from turbogears.widgets.datagrid import DataGrid

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):
    @turbogears.expose()
    def dg(self):
        grid = DataGrid(fields=[
            ('ID', 'userId'),
            ('Name', 'displayName'),
            ('E-mail', 'emailAddress'),
        ])
        users = [User(1, 'john', '[EMAIL PROTECTED]'), User(2, 'fred',
'[EMAIL PROTECTED]')]
        grid.display(users)

Probably it's just a small thing but I can't find the solution :-(

Thanks for your help.
Regards,

Fabian


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to