#28766: Add route information to ResolverMatch -------------------------------------+------------------------------------- Reporter: Benjamin Wohlwend | Owner: Benjamin | Wohlwend Type: New feature | Status: assigned Component: Core (URLs) | Version: 2.0 Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by Benjamin Wohlwend): Replying to [comment:3 Tim Graham]: > For URL patterns that use `re_path()` is the route already available from `ResolverMatch`? If not, I'm unsure why this attribute would only be set for `path()`. `re_path()` uses `RegexPattern`, which doesn't have a route, but a regex. Do you think the regex should be set in that case? That would simplify the code a bit. Instead of `getattr(pattern._route)`, we could just use `str(pattern)` (`__str__` prints `_route` for `RoutePattern` objects, and `_regex` for `RegexPattern`). -- Ticket URL: <https://code.djangoproject.com/ticket/28766#comment:4> 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 unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.f05526c8013e742b8bd097f08be43549%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.