Skip to content

Support URLPattern and URLResolver from Django 2.0 #5500

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Oct 16, 2017
Merged

Support URLPattern and URLResolver from Django 2.0 #5500

merged 2 commits into from
Oct 16, 2017

Conversation

mkuznets
Copy link
Contributor

Description

Fixes #5456

My attempt to make sense of the new URL routing API from Django 2.0:

  • RegexURLPattern and RegexURLResolver are renamed to URLPattern and URLResolver respectively.
  • Their regexes are now encapsulated inside RegexPattern/RoutePattern instances and are located at self.pattern.regex (was self.regex).
  • Both url() and the new path() return URLPattern. So, no changes needed to support the new routing syntax.

@carltongibson carltongibson added this to the 3.7.1 Release milestone Oct 16, 2017
Copy link
Collaborator

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mkuznets Great stuff. Really clears up the test suite a lot!

Thanks for the input.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants