Hi,

On Nov 5, 2006, at 7:38 AM, Tim Lesher wrote:

>
> I'm seeing different behavior in rendering simplistic widgets between
> 1.0 and trunk (rev 2052).
>
> If I quickstart a new simple project and add the following to the
> controllers.py:
>
> class HelloKidWidget(widgets.Widget):
>     template='''<p xmlns:py="http://purl.org/kid/ns#";>Hello, Kid!</ 
> p>'''
> hello_kid = HelloKidWidget()
>
> class HelloGenshiWidget(widgets.Widget):
>     template='''<p xmlns:py="http://genshi/edgewall.org/";>Hello,  
> Genshi!</p>'''
> hello_genshi = HelloGenshiWidget()
>
> class Root(controllers.RootController):
>     @expose(template="wtest.templates.welcome")
>     def index(self):
>         return dict(hk=hello_kid, hg=hello_genshi)
>
> Then in either welcome.kid (1.0) or welcome.html, I add this just
> after the <body> tag:
>
> <hr/>
> ${hk()}
> <hr/>
> ${hg()}
> <hr/>
>
> In 1.0, I see both widgets displayed; in 1.1, I see neither.

In 1.0 kid is rendering both widgets, in trunk you need to specify  
the engine name:

class GenshiTextField(widgets.TextField):
     template = """
     <input xmlns="http://www.w3.org/1999/xhtml";
            xmlns:py="http://genshi.edgewall.org/";
         type="text"
         name="${name}"
         class="${field_class}"
         id="${field_id}"
         value="${value}"
         py:attrs="attrs"
     />
     """
     template_engine = "genshi"

>
> Is this a Genshi issue, or has something else fundamentally changed
> that would make the above widgets invalid?

In trunk widgets can use different template engines (though it hasn't  
been tested much). BTW, I'm no longer mantaining the widgets in trunk  
but TGWidgets (http://tgwidgets.toscat.net). If you want to use  
Genshi as a template language for widgets I'd recomend you to switch  
to these though the API has slightly changed (for the better I hope).

I'm planning to document these changes and more as soon as I have a  
chance

Alberto


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" 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-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to