Hi Daniele,
On 03/21/2013 02:07 AM, Daniele Procida wrote:
> 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'}I don't think this is necessary. The url resolver module does not call anything; it just returns ResolverMatch objects with "func", "args", and "kwargs" attributes (where "func" is a view function). I think it would make more sense to leave the url-resolver alone, and build your system around it; if you have a way to map a view-func plus args/kwargs to a model instance (which is more or less what you'll need in any implementation of this idea), then you can get the ResolverMatch from the url resolver and resolve that to a model. Carl
signature.asc
Description: OpenPGP digital signature
