Thanks for the response.  Sorry for not providing more details.

Here's controllers.py:

###############################
import logging

import cherrypy

import turbogears
from turbogears import controllers, expose, validate, redirect

from wiki20 import json

from wiki20.model import Page
from docutils.core import publish_parts

log = logging.getLogger("wiki20.controllers")

class Root(controllers.RootController):
    @expose(template="wiki20.templates.page")
    def index(self):
        import time
        log.debug("Happy TurboGears Controller Responding For Duty")
        return dict(now=time.ctime())

@expose("wiki20.templates.page")
def index(self, pagename="FrontPage"):
    page = Page.byPagename(pagename)
    content = publish_parts(page.data,
                            writer_name="html")["html_body"]
    return dict(data=content, page=page)
#########################################

Here's model.py:


#########################################
from sqlobject import *

from turbogears.database import PackageHub

hub = PackageHub("wiki20")
__connection__ = hub

# class YourDataClass(SQLObject):
#     pass

class Page(SQLObject):
    pagename = UnicodeCol(alternateID=True, length=30)
    data = UnicodeCol()
########################################


Here's page.kid:

######################################
<!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://purl.org/kid/ns#";
    py:extends="'master.kid'">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"
py:replace="''"/>
<title>Welcome to TurboGears</title>
</head>
<body>
<div style="float:right; width: 10em">
    Viewing <span py:replace="page.pagename">Page Name Goes Here</span>
    <br/>
    You can return to the <a href="/">FrontPage</a>.
</div>

<div py:replace="XML(data)">Page text goes here.</div>
</body>
</html>
####################################################


Here's the screen error messages:

#####################################################
500 Internal error

The server encountered an unexpected condition which prevented it from
fulfilling the request.

Page handler: <bound method Root.index of <wiki20.controllers.Root
object at 0x0163D650>>
Traceback (most recent call last):
  File
"c:\python24\lib\site-packages\CherryPy-2.2.1-py2.4.egg\cherrypy\_cphttptools.py",
line 105, in _run
    self.main()
  File
"c:\python24\lib\site-packages\CherryPy-2.2.1-py2.4.egg\cherrypy\_cphttptools.py",
line 254, in main
    body = page_handler(*virtual_path, **self.params)
  File "<string>", line 3, in index
  File
"c:\python24\lib\site-packages\TurboGears-1.0b1-py2.4.egg\turbogears\controllers.py",
line 326, in expose
    output = database.run_with_transaction(
  File "<string>", line 5, in run_with_transaction
  File
"c:\python24\lib\site-packages\TurboGears-1.0b1-py2.4.egg\turbogears\database.py",
line 246, in so_rwt
    retval = func(*args, **kw)
  File "<string>", line 5, in _expose
  File
"c:\python24\lib\site-packages\TurboGears-1.0b1-py2.4.egg\turbogears\controllers.py",
line 343, in <lambda>
    mapping, fragment, args, kw)))
  File
"c:\python24\lib\site-packages\TurboGears-1.0b1-py2.4.egg\turbogears\controllers.py",
line 380, in _execute_func
    return _process_output(output, template, format, content_type,
mapping, fragment)
  File
"c:\python24\lib\site-packages\TurboGears-1.0b1-py2.4.egg\turbogears\controllers.py",
line 74, in _process_output
    fragment=fragment)
  File
"c:\python24\lib\site-packages\TurboGears-1.0b1-py2.4.egg\turbogears\view\base.py",
line 131, in render
    return engine.render(**kw)
  File
"c:\python24\lib\site-packages\TurboKid-0.9.9-py2.4.egg\turbokid\kidsupport.py",
line 174, in render
    return t.serialize(encoding=self.defaultencoding, output=format,
fragment=fragment)
  File
"c:\python24\lib\site-packages\kid-0.9.3-py2.4.egg\kid\__init__.py",
line 236, in serialize
    return serializer.serialize(self, encoding, fragment)
  File
"c:\python24\lib\site-packages\kid-0.9.3-py2.4.egg\kid\serialization.py",
line 51, in serialize
    text = list(self.generate(stream, encoding, fragment))
  File
"c:\python24\lib\site-packages\kid-0.9.3-py2.4.egg\kid\serialization.py",
line 329, in generate
    for ev, item in self.apply_filters(stream):
  File "c:\python24\lib\site-packages\kid-0.9.3-py2.4.egg\kid\pull.py",
line 210, in _coalesce
    for ev, item in stream:
  File
"c:\python24\lib\site-packages\kid-0.9.3-py2.4.egg\kid\filter.py", line
21, in transform_filter
    for ev, item in apply_matches(stream, template, templates,
apply_func):
  File
"c:\python24\lib\site-packages\kid-0.9.3-py2.4.egg\kid\filter.py", line
31, in apply_matches
    item = stream.expand()
  File "c:\python24\lib\site-packages\kid-0.9.3-py2.4.egg\kid\pull.py",
line 99, in expand
    for ev, item in self._iter:
  File "c:\python24\lib\site-packages\kid-0.9.3-py2.4.egg\kid\pull.py",
line 168, in _track
    for p in stream:
  File "c:\python24\lib\site-packages\kid-0.9.3-py2.4.egg\kid\pull.py",
line 210, in _coalesce
    for ev, item in stream:
  File "C:\Python24\Scripts\Wiki-20\wiki20\templates\page.py", line 59,
in _pull
NameError: name 'page' is not defined


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

Reply via email to