On 10/21/2010 9:36 AM, Phlip wrote:
> On Oct 21, 5:26 am, Scott Gould <zinck...@gmail.com> wrote:
> 
>> What's your use case? Are "nest, pest and rest" always "nest, pest and
>> rest" -- or could they be "rest, pest and nest", or "nest, best, and
>> rest"?
> 
> Tx but - the use case is we can't do it like you said. C-:
> 
> The point is a REST path that can go arbitrarily shallow or deep
> without excessive code.
> 
REST, however, has a fairly rigid one-URL-one-action structure which is
ideally suited to Django's URL dispatch. The only way to get what you
want is to layer another dispatching service atop Django's. I don't
think you can do it with urlconfs alone.

> What I looked for was a lambda here (simplified):
> 
>   url( 'nest', lambda *a,**k: doit(a, k) )
> 
> but that terminates the lookup on the last item (rest), instead of
> calling the lambda on the way down!
> 
By the way, what are you imagining the functions nest(), pest() and
rest() will return? They cannot all return HTTP responses, since there
can only be a single response to a single request?

Perhaps a somewhat more detailed description of your requirements is in
order.

regards
 Steve
-- 
DjangoCon US 2010 September 7-9 http://djangocon.us/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to