[mod_python] Re: How to do multi-level dispatch with Vampire

Jeff Hinrichs - DM&T jeffh at dundeemt.com
Thu May 3 21:06:42 EDT 2007


On 5/3/07, Jeff Hinrichs - DM&T <jeffh at dundeemt.com> wrote:
> with mod_python + vampire what is the proper way to dispatch something like:
>  /jobs/view/7
>
> I'm thinking of this idiom since it is common in some other frameworks,
>
> def _jobs_view(req,path):
>     return 'using _jobs_view'
>
> def _jobs(req, path):
>     d = path.split('/')
>     if d[1] = 'view':
>         return _jobs_view(req, path)
>     else:
>         return 'unknown action'
>
> job = vampire.PathInfo(_jobs)
>
>
> I'm trying to make a RESTful api, i.e. /jobs/view/N, /jobs/edit/N, etc
>
> /Thanking/you/jeff
>
>
I completely, and forgot to mention and important part, I'm using
PythonHandler vampire::publisher

and not the handler portion of vampire.

-Jeff


More information about the Mod_python mailing list