Diez,

thanks for getting back to me so in other word in the controller method do
the followiing
*def index( ): remove the parameter

*In my template I have the following code:
<p><a href="entertext?">View complete page list</a></p>


However I am getting the following error below. I don't understand how I am
passing a parameter. Can someone
out there explain to me the basics of creating templates.





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 0x0168F5D0>>
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)
  File "<string>", line 3, in index
  File 
"c:\python25\lib\site-packages\TurboGears-1.0.4.2-py2.5.egg\turbogears\controllers.py",
line 344, in expose
    *args, **kw)
  File "<string>", line 5, in run_with_transaction
  File 
"c:\python25\lib\site-packages\TurboGears-1.0.4.2-py2.5.egg\turbogears\database.py",
line 356, in so_rwt
    retval = func(*args, **kw)
  File "<string>", line 5, in _expose
  File 
"c:\python25\lib\site-packages\TurboGears-1.0.4.2-py2.5.egg\turbogears\controllers.py",
line 359, in <lambda>
    mapping, fragment, args, kw)))
  File 
"c:\python25\lib\site-packages\TurboGears-1.0.4.2-py2.5.egg\turbogears\controllers.py",
line 386, in _execute_func
    output = errorhandling.try_call(func, *args, **kw)
  File 
"c:\python25\lib\site-packages\TurboGears-1.0.4.2-py2.5.egg\turbogears\errorhandling.py",
line 72, in try_call
 *   return func(self, *args, **kw)
TypeError: index() takes no arguments (1 given)*



On Feb 6, 2008 4:41 AM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote:

> On Tuesday 05 February 2008 23:25:33 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)
>
> You declared the index-method with a pagename-argument. But I bet you
> don't
> give it to it when invoking it. REmove the unneeded parameter, or make it
> a
> keyword-argument with a default-value.
>
> Diez
>

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