Alberto Valverde ha scritto:
On Jan 19, 2007, at 4:35 PM, Jose Soares wrote:
Alberto Valverde ha scritto:
On Jan 19, 2007, at 8:16 AM, jose wrote:
I'm using version 1.0
The following lines in my start.py changes tg behavior about
using kid/genshi.
import toscawidgets
from toscawidgets.mods.tg import Turbogears
toscawidgets.framework = Turbogears(None)
Whithout these lines I have no more the errors:
ValueError: need more than 2 values to unpack
or
ValueError: too many values to unpack
and I am able to use genshi and kid as in version 1.0b2 but
ToscaWidgets.
Could someone tell me please, how to configure my tg to use
ToscaWidgets and widgest with genshi and kid?
Take a look at http://tinyurl.com/37hm2t.
ToscaWidget's Widget.display function automatically converts kid/
genshi streams into string output and viceversa to allow mixing
template engines. When a widget is root (it's not displayed inside
any other widget) it looks at toscawidgets.framework.default_view
to see the template engine root widgets are displayed on. In TG
it delegates to the tg.default_view config option by default, if
you want to display a TW in a non-default template engine you must
set that attribute manually before rendering the template (yes, it
is threadsafe and the change will only last for the duration of a
request).
Alberto
the demo gives me an AttributeError when I try http://
10.0.0.114:8080/genshi:
....
output = errorhandling.try_call(func, *args, **kw)
File "/usr/lib/python2.4/site-packages/TurboGears-1.0-py2.4.egg/
turbogears/errorhandling.py", line 73, in try_call
return func(self, *args, **kw)
File "/home/jose/TWSamples/tgsample/tgsample/controllers.py", line
46, in genshi
framework.default_view = 'genshi'
AttributeError: can't set attribute
You're probably using an outdated TW version (this is moving fast! ;)
and I haven't set up the requirements properly to warn you. Upgrade
TW with:
easy_install -U ToscaWidgets==dev
FYI: I'll probably release ToscaWidgets 0.1a1 (the first alpha) later
today (along with Turbogears 1.0.1) so hopefully you'll have
something more "stable" to hang onto. :)
Alberto
ok, then I will wait for release 1.0.1
jo
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---