Skip to content

Commit

Permalink
Add URLResolversTransformer
Browse files Browse the repository at this point in the history
  • Loading branch information
jayvdb committed Jul 4, 2020
1 parent 1b9f0e1 commit 4803651
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions django_codemod/visitors/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .admin import InlineHasAddPermissionsTransformer
from .core import URLResolversTransformer
from .decorators import AvailableAttrsTransformer, ContextDecoratorTransformer
from .encoding import (
ForceTextTransformer,
Expand Down Expand Up @@ -47,6 +48,7 @@
"UNGetTextLazyTransformer",
"UNGetTextTransformer",
"URLTransformer",
"URLResolversTransformer",
"UnescapeEntitiesTransformer",
"UnicodeCompatibleTransformer",
)
11 changes: 11 additions & 0 deletions django_codemod/visitors/core.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from django_codemod.constants import DJANGO_20
from django_codemod.visitors.base import BaseSimpleRenameTransformer


class URLResolversTransformer(BaseSimpleRenameTransformer):
"""Resolve deprecation of ``django.conf.urls.url``."""

deprecated_in = DJANGO_20
removed_in = DJANGO_20
rename_from = "django.core.urlresolvers"
rename_to = "django.urls"

0 comments on commit 4803651

Please sign in to comment.