Alberto Valverde wrote:
> Tim Black wrote:
>> Khalid EZZARAOUI wrote:
>>> in fact i use python2.5 and turbogears-1.0.4beta1
>>> and this work without using "tostring()" :
>>>
>>> def makePlaceLink(place):
>>> link = Element('a', href='/placeManager/place/%d' % place.id)
>>> link.text = place
>>> return link
>>>
>>> def index(self):
>>> the_place_fields = [
>>> ('Place', makePlaceLink)
>>> ('DeltaT', makeDeltaT),
>>> ....
>>>
>> Ok, I was using ToscaWidgets' DataGrid, and it doesn't work there. I
>> tried it in a TurboGears DataGrid and it works. So, the problem is that
>> ToscaWidgets' DataGrid doesn't handle elementtree Elements properly. I
>> tried comparing the code in the two datagrid.py files, but wasn't able
>> to see where the important difference is. Perhaps someone can find the
>> necessary change and submit a patch to Alberto.
>
> TW DataGrid's template uses Genshi instead of Kid, that's why the
> elementtree nodes you're creating don't get grafted in properly.
>
> You should be using Genshi's API for programatically creating markup
> streams: http://genshi.edgewall.org/wiki/ApiDocs/genshi.builder.
>
> Alternatively, you could override the DataGrid's template with a Kid
> based one.
.. or you could use a widget as a custom renderer for that column since
widgets can be called as an alias for display(). Take a look at twGrids
(in TG's svn at /projects/twGrids) to see how it can be done.
Alberto
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---