Skip to content

Commit bdcfebd

Browse files
committed
Fix Django 1.6 support, use new django.conf.urls import path.
1 parent 0ccb5b0 commit bdcfebd

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Changes in version 0.8.7 (beta release)
22
---------------------------------------
33

44
* Fix Django 1.5 support in the templates
5+
* Fix Django 1.6 support, use new ``django.conf.urls`` import path.
56

67

78
Changes in version 0.8.6 (beta release)

polymorphic_tree/admin/parentadmin.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
from django.conf import settings
2-
from django.conf.urls.defaults import url
2+
from django.conf.urls import url
33
from django.core.urlresolvers import reverse
4-
from django.db import router
5-
from django.db.models import signals
64
from django.db.transaction import commit_on_success
75
from django.http import HttpResponseNotFound, HttpResponse, HttpResponseBadRequest, HttpResponseRedirect
86
from django.utils import simplejson
@@ -11,6 +9,13 @@
119
from polymorphic_tree.models import PolymorphicMPTTModel
1210
from mptt.admin import MPTTModelAdmin
1311

12+
try:
13+
# Django 1.6 requires this
14+
from django.conf.urls import url
15+
except ImportError:
16+
# Django 1.3 compatibility
17+
from django.conf.urls.defaults import url
18+
1419

1520
class NodeTypeChoiceForm(PolymorphicModelChoiceForm):
1621
type_label = _("Node type")

0 commit comments

Comments
 (0)