#16774: Backtracking URL resolver -------------------------------+------------------------------------ Reporter: nbstrite | Owner: nobody Type: New feature | Status: new Component: HTTP handling | Version: 1.3 Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 1 Easy pickings: 0 | UI/UX: 0 -------------------------------+------------------------------------ Changes (by julien):
* needs_better_patch: 0 => 1 Comment: The patch looks great. Nice work! I've updated it to current trunk. I had a few remarks and questions regarding the implementation: * Would it be possible to implement the generator as a class rather than a private method of `RegexURLResolver`, or even merge it with `ResolverMatches`? That would seem cleaner. * Shouldn't the backtracking functionality be enabled by default, i.e. done by `RegexURLResolver.resolve()` itself, since it is meant to be backwards-compatible? I'm not sure we need two separate methods (`resolve()` and `backtracking_resolve()`). * The 'peeking' implementation in `ResolverMatches` feels a bit convoluted. Could it be simplified by using a buffer? See: http://stackoverflow.com/questions/1517862/using-lookahead-with- generators/1517965#1517965 * I'm not sure `ContinueResolving` is a good name for the exception, since the exception is meant to be raised by the view and the name is quite suggestive about the implementation that happens outside of the view (i.e. in the resolver). As far as the view is concerned, the only thing it cares to say is "Do not use me", or "Skip me", so a name like `SkipView`, for example, would seem more appropriate. Other than that, I think it's already in great shape and it's getting pretty close! -- Ticket URL: <https://code.djangoproject.com/ticket/16774#comment:9> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.