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.
>   
Thank you!  That solves the problem.  From now on I'll remember to read 
the genshi docs too.  I'm excited about how easy genshi.builder.tag's 
syntax is!

Tim Black

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