Karl Guertin wrote:
> On 3/3/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >     @turbogears.expose(html=".templates.page")
> > NameError: name 'turbogears' is not defined
>
> At the top of your file, you have to `import turbogears`

Did that still failed, here are the two files (basically copied from
wiki20 tutorial),
any other suggestion, thanks in advance for your help.

debian:/app/Wiki-20# cat wiki20/controllers.py
import turbogears
from model import Page
from docutils.core import publish_parts

@turbogears.expose(html=".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, pagename=page.pagename)

debian:/app/Wiki-20# cat wiki20/model.py
from sqlobject import *
from turbogears.database import PackageHub
# Uncomment the following line if you wish to use Identity and
SO_Provider
# from turbogears.identity.soprovider import TG_User, TG_Group,
TG_Permission

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

debian:/app/Wiki-20# python2.4 start-wiki20.py
Traceback (most recent call last):
  File "start-wiki20.py", line 4, in ?
    from controllers import Root
ImportError: No module named controllers


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