On Wed, Mar 20, 2013, Carl Meyer <c...@oddbird.net> wrote:

>> Often - not always but often - a Django URL will map to a model
>> instance via a URLconf and a view

>I think this is an interesting idea for some specific use cases, but I
>don't think its implementation belongs in the core url-resolver code,
>for a couple reasons

>If you work on implementing this outside Django and find that you need
>hooks that are not currently available, those hooks would making
>interesting feature proposals for Django.

Thanks for the feedback.

I think it would at minimum require hooks so that the URL dispatcher could call 
other functions, not just views.

So:

* the URL dispatcher could be invoked with a special argument when you want it 
not to call views but perform some other function

* the URL confs could take this argument, and call the function it specifies 
instead of the usual view, failing gracefully if the function doesn't exist


I guess it would have to be a keyword argument such as:

    { 'alternative_function': 'some.alternative.function'}

In fact this would allow you to use the URL dispatcher for other URL-related 
things, not just my URL-to-model functionality (though I can't think of 
anything very useful just at this moment).

Then as you say the actual functionality would be built outside Django itself.

How does that sound?

Daniele

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to