the callable url ( in your case /entertext) is named after the
function name, not after the template name.

example:

i want a page called '/entertext', exposed using a template named
entertext.kid

So in controllers.py I'll have:

class Root(controllers.RootController):

    @expose(template='deceptive.templates.page')
    def index():
        return dict()

    @expose(template='deceptive.templates.template') # if your project
is named 'deceptive'
    def entertext(self):
        return dict(pagename='my very descriptive pagename')

So you'll have:
/ -> index method exposed using page.kid
and
/entertext -> entertextmethod exposed using entertext.kid

Bye,
Michele

hoboro wrote:
> I am new to Turbo Gears and have gone through the Wiki-20 tutorial. I
> have a simple requirement:
>
>
> 1. Enter Text
> Click on the above link and open a new page from entertext.kid. Here
> is what I have done
>
>
> I have added the following code in controller.py
>
>    @expose(template='deceptive.templates.entertext')
>     def index(self,pagename):
>          redirect("/"+"entertext")
>
> In the page.kid from where my link exists
>
> <p><a href="entertext?">1. Enter Text</a></p>
>
>
> When I start the server I am getting the following error:
>
>
> 500 Internal error
>
> The server encountered an unexpected condition which prevented it from
> fulfilling the request.
>
> Page handler: <bound method Root.index of <deceptive.controllers.Root
> object at 0x0167B610>>
> Traceback (most recent call last):
>   File "c:\python25\lib\site-packages\cherrypy-2.3.0-py2.5.egg\cherrypy
> \_cphttptools.py", line 121, in _run
>     self.main()
>   File "c:\python25\lib\site-packages\cherrypy-2.3.0-py2.5.egg\cherrypy
> \_cphttptools.py", line 264, in main
>     body = page_handler(*virtual_path, **self.params)
> TypeError: index() takes at least 2 arguments (1 given)
>
>
> Any help appreciated
>
> Thanks

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

Reply via email to