"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:

> In a controllers function I am trying to grab the requested resource
> name.
>
> For instance if the user enters "http://localhost:8080/hello";, I would
> like to grab the "hello" part.
>
> I tried searching "cherrypy.request.headers", but the resource name
> does not exist there.

Are you inside a "hello" controller?  If so, there's nothing there indeed.  If
you aren't then you can catch the first argument as args[0] if you use a
signature like

          def index(self, *args, **kwargs):
              # ...

(kwargs is optional in you case, it would handle named arguments).

There's also something in CP that gives you the URI of the request...  Check
its docs again.  I don't remember exactly the name.

-- 
Jorge Godoy      <[EMAIL PROTECTED]>

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