Am 16.04.2009 um 21:12 schrieb Steve Howell: > http://www.djangosnippets.org/snippets/1444/ > > In writing this code, it occurs to me that other advanced users might > want more control over URL resolution, and it seems to me that a > valuable piece of information would be the "name" of the URL, i.e. the > same name that gets used for reverse mappings. Then, if folks want to > change the dispatch of URLs in some way, they can use the name as a > guide for adding extra parameters, using a different callback, etc. > So I'm wondering if it would make sense to have URRegexResolver have > an alternative to resolve() called resolve_with_name() that returns > not just the callback and arguments, but also the name, and I suppose > also the regex could be useful in some cases. > > As my snippet is currently written, in order to change the dispatch > for individual view functions, I have to hack into the internals more > than I like. I don't think my code is too risky, but it would have > been a lot simpler if I could have created a wrapper around > URLRegexResolver with my own custom resolve() method that called > URLRegexResolver.resolve_with_name() to do the heavy lifting.
I've had a similar need in the past and actually posted something similar to djangosnippets: http://www.djangosnippets.org/snippets/1378/ Now that code is obviously a hack so don't look too hard ;) But I think that maybe there is a need for some kind of resolve_to_name functionality. Bye, Ulrich --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---