List Info

Thread: Dynamic URL mapping (/foo/bar -> /foo?obj=bar)




Dynamic URL mapping (/foo/bar -> /foo?obj=bar)
user name
2006-02-15 03:37:37
Looking at the recipie for dynamically adding objects to a
tree... it's
almost what I need:

    http://www.cherry
py.org/wiki/Attach

The issue is that there would be a lot of objects to add --
too many,
in fact. I need more of a dynamic lookup kind of deal, where
a method
is called on 404 or something. I've considered doing a
mod_rewrite that
would be like /foo/bar -> /foo?obj=bar, but that
precludes dynamic
development directly with cherrypy's webserver.

Thoughts?

-Ken

Dynamic URL mapping (/foo/bar -> /foo?obj=bar)
user name
2006-02-15 04:11:05
I think all you need is a default method.

cherrypy.expose
def default(self, item):
    return self.index(obj=item)

Kevin

On 2/14/06, Ken <kkindergmail.com> wrote:
>
> Looking at the recipie for dynamically adding objects
to a tree... it's
> almost what I need:
>
>     http://www.cherry
py.org/wiki/Attach
>
> The issue is that there would be a lot of objects to
add -- too many,
> in fact. I need more of a dynamic lookup kind of deal,
where a method
> is called on 404 or something. I've considered doing a
mod_rewrite that
> would be like /foo/bar -> /foo?obj=bar, but that
precludes dynamic
> development directly with cherrypy's webserver.
>
> Thoughts?
>
> -Ken
>
>


--
Kevin Dangoor
Author of the Zesty News RSS newsreader

email: kidblazingthings.com
company: http://www.BlazingThings
.com
blog: http://www.BlueSkyOnMars
.com
Dynamic URL mapping (/foo/bar -> /foo?obj=bar)
user name
2006-02-15 04:00:28
Aha! I found that you can make a filter that modifies
cherrypy.request.object_path. Is this the correct way to do
it?

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )