SmokeyD schrieb:
> 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?

You are. Because "Class.foo" is always a string, but when you want to 
pass a callable, you do

Class.foo

Note the missing quotes.

Go to the interpreter and type

 >>> def foo(): pass
...
 >>> foo
<function foo at ...>

Do that for a class-method as well.

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