Hi,
I tried to use the TurboGears 2 TreeView example , but I got the error
below:
UndefinedError: <pylons.util.ContextObj at 0x268b770
action=u'routes_placeholder', controller=u'root', controller_url='',
environ={'routes.route': <routes.route.Route object at
0x00EB2550>, ...ate'}, form_errors={}, form_values={}, identity=None,
pylons=<pylons.util.PylonsContext object at 0x0268B7D0>,
start_response=<function repl_start_response at 0x02674670>,
url=u'about'> has no member named "tree"
Looks like tmpl_context has no member named "tree". Am I missing
anything here? Please shed a light on how to debug this? Thanks much
in advance.
tpn
>From my controller (root.py):
===================
import pylons
from pylons import *
from tw.jquery import TreeView
@expose('helloworld.templates.about')
def about(self, **kw):
myTree = TreeView(treeDiv='navTree')
pylons.c.tree = myTree
return dict()
Here is my about.html
================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="master.html" />
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type"
py:replace="''"/>
<title>Welcome</title>
</head>
<body>
${tmpl_context.tree()}
<div id="navTree">
<ul>
<li class="open">TurboGears2
<ul>
<li><a href="http://docs.turbogears.org/
2.0">Documentation</a></li>
<li><a href="http://docs.turbogears.org/2.0/API">API
Reference</a></li>
<li><a href="http://trac.turbogears.org/turbogears/">Bug
Tracker</a></li>
<li><a href="http://groups.google.com/group/
turbogears">Mailing List</a></li>
</ul>
</li>
<li class="closed">Pylons
<ul>
<li><a href="http://wiki.pylonshq.com/display/pylonsdocs/
Home">Documentation</a></li>
<li><a href="http://wiki.pylonshq.com/display/pylonsfaq/
Home">FAQ</a></li>
<li><a href="http://pylonshq.com/project/">Bug Tracker</
a></li>
<li><a href="http://groups.google.com/group/pylons-
discuss">Mailing List</a></li>
</ul>
</li>
<li class="closed">SQLAlchemy
<ul>
<li><a href="http://www.sqlalchemy.org/
docs/">Documentation</a></li>
<li><a href="http://www.sqlalchemy.org/trac/wiki/
FAQ">FAQ</a></li>
<li><a href="http://www.sqlalchemy.org/trac/query">Bug
Tracker</a></li>
<li><a href="http://groups.google.com/group/
sqlalchemy">Mailing List</a></li>
</ul>
</li>
</ul>
</div>
</body>
</html>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---