I think just clarifying the docs would be fine. It works nicely the
way it is. I am happy to learn to is possible to pass callables, even
lambdas and such. Really helpfull.
Thanks for all the help. A new question is coming up though (new
thread).
Dolf.
On Feb 18, 2:09 pm, Chris Arndt <[EMAIL PROTECTED]> wrote:
> On 18 Feb., 11:10, SmokeyD <[EMAIL PROTECTED]> wrote:
>
> > Well, the attrwrapper uses getattr to get the value for the field, and
> > therefore accepts strings instead of the attribute itself.
> > For instance
> > DataGrid(fields=[("prettyname","classattr")]).display(value=ModelClassInstance)
> > works. That is also what the docs show you. I did not know that doing
> > DataGird(fields=[("prettyname",ModelClass.classattr)]).display(value=ModelClassInstance)
> > would also work. Thanks for the tip. I'll try it.
>
> Ok, so we should clarify in the docs that for attributes you need to
> give the attribute name as a string, whereas for methods you need to
> pass the method object itself (since this is just a special case of
> passing a callable).
>
> Does this make sense? Or should we allow to pass method names a
> strings as well, like the patch implements?
>
> Chris
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---