Skip to content

Commit

Permalink
Merge branch 'master' into pr315
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardopires committed Mar 28, 2016
2 parents 3d0e746 + 14ff595 commit ffc8e09
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
13 changes: 9 additions & 4 deletions examples/tenant_tutorial/tenant_tutorial/urls_public.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
from django.conf.urls import patterns, url
import django
from django.conf.urls import url
from tenant_tutorial.views import HomeView

urlpatterns = patterns('',
url(r'^$', HomeView.as_view()),
)

urlpatterns = [
url(r'^$', HomeView.as_view()),
]

if django.VERSION < (1, 9, 0):
urlpatterns = django.conf.urls.patterns('', *urlpatterns)
13 changes: 9 additions & 4 deletions examples/tenant_tutorial/tenant_tutorial/urls_tenants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
from django.conf.urls import patterns, url
import django
from django.conf.urls import url
from customers.views import TenantView

urlpatterns = patterns('',
url(r'^$', TenantView.as_view()),
)

urlpatterns = [
url(r'^$', TenantView.as_view()),
]

if django.VERSION < (1, 9, 0):
urlpatterns = django.conf.urls.patterns('', *urlpatterns)
10 changes: 7 additions & 3 deletions tenant_schemas/urlresolvers.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import warnings
from django.conf import settings
from django.core.urlresolvers import reverse as reverse_default
from django.utils.functional import lazy
from tenant_schemas.utils import clean_tenant_url


def reverse(viewname, urlconf=None, args=None, kwargs=None, prefix=None,
current_app=None):
url = reverse_default(viewname, urlconf, args, kwargs, prefix, current_app)
url = reverse_default(
viewname=viewname,
urlconf=urlconf,
args=args,
kwargs=kwargs,
current_app=current_app
)
return clean_tenant_url(url)

reverse_lazy = lazy(reverse, str)

0 comments on commit ffc8e09

Please sign in to comment.