Diez,

I don't understand completely. When I pass a ModelClass.method as the
getter in a tuple of the fields property, the method is not called but
just "<instance method.....>" or something similar is returned. That
was the whole point of my code, to allow the passing of a
ModelClass.Method as the second entry in the tuples of the fields
list.
I found (but maybe I did something wrong) that
DataGrid(fields=[('prettyname','ModelClass.method')]) does not result
in ModelClass.method being called to retrieve the value for the
'prettyname' column for each row. Am I mistaken?
Thanks,

Dolf.

On Feb 17, 5:47 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> SmokeyD schrieb:
>
> > Hey people,
>
> > I have a suggestion for the attrwrapper class of
> > turbogers.widgets.DataGrid.Column.
> > At the moment it is impossible to define a method as the value getter
> > of the value of a cell in the DataGrid.
> > It is possible to use DataGrid(fields=[('Name','name')]) but not
> > DataGrid(fields=[('Name','getname()')]) or something similar. I
> > defined my own DataGridMod where the attrwrapper.__call__ checks if
> > the attribute is callable, and if so, calls it, if not, just returns
> > the value of the attribute.
> > Now when I use fields=[('Name','name')], it doesn't matter if 'name'
> > is a method or an attribute.
> > Other modifications are just to make sure this behaviour is working
> > correctly.
>
> After rereading your post, I do get what you are after now - but I still
> don't see the need. You can just pass
>
> ModelClass.method
>
> as argument - which I prefer, as this will catch any error earlier (at
> definition time of the grid, not at evaluation time of one row)
>
> Diez
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to