Browse files

import url with fallback support for django<1.4

  • Loading branch information...
1 parent 856f0f1 commit 8c1cfb29f32ceed712efa20c3cb78f2b6ed164a1 @stefanfoulis stefanfoulis committed Jan 5, 2013
View
7 filer/admin/clipboardadmin.py
@@ -24,7 +24,12 @@ class ClipboardAdmin(admin.ModelAdmin):
verbose_name_plural = "DEBUG Clipboards"
def get_urls(self):
- from django.conf.urls.defaults import patterns, url
+ try:
+ # django >=1.4
+ from django.conf.urls import patterns, url
+ except ImportError:
+ # django <1.4
+ from django.conf.urls.defaults import patterns, url
urls = super(ClipboardAdmin, self).get_urls()
from filer import views
url_patterns = patterns('',
View
7 filer/admin/folderadmin.py
@@ -156,7 +156,12 @@ def icon_img(self, xs):
icon_img.allow_tags = True
def get_urls(self):
- from django.conf.urls.defaults import patterns, url
+ try:
+ # django >=1.4
+ from django.conf.urls import patterns, url
+ except ImportError:
+ # django <1.4
+ from django.conf.urls.defaults import patterns, url
urls = super(FolderAdmin, self).get_urls()
from filer import views
url_patterns = patterns('',
View
7 filer/server/main_server_urls.py
@@ -1,5 +1,10 @@
#-*- coding: utf-8 -*-
-from django.conf.urls.defaults import patterns, url
+try:
+ # django >=1.4
+ from django.conf.urls import patterns, url
+except ImportError:
+ # django <1.4
+ from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('filer.server.views',
url(r'^(?P<path>.*)$', 'serve_protected_file',),
View
7 filer/server/thumbnails_server_urls.py
@@ -1,5 +1,10 @@
#-*- coding: utf-8 -*-
-from django.conf.urls.defaults import patterns, url
+try:
+ # django >=1.4
+ from django.conf.urls import patterns, url
+except ImportError:
+ # django <1.4
+ from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('filer.server.views',
url(r'^(?P<path>.*)$', 'serve_protected_thumbnail',),
View
7 filer/server/urls.py
@@ -1,5 +1,10 @@
#-*- coding: utf-8 -*-
-from django.conf.urls.defaults import patterns, url, include
+try:
+ # django >=1.4
+ from django.conf.urls import patterns, url, include
+except ImportError:
+ # django <1.4
+ from django.conf.urls.defaults import patterns, url, include
from filer import settings as filer_settings
if not filer_settings.FILER_0_8_COMPATIBILITY_MODE:
View
7 test_urls.py
@@ -1,5 +1,10 @@
#-*- coding: utf-8 -*-
-from django.conf.urls.defaults import patterns, include, url
+try:
+ # django >=1.4
+ from django.conf.urls import patterns, url, include
+except ImportError:
+ # django <1.4
+ from django.conf.urls.defaults import patterns, url, include
from django.contrib import admin
admin.autodiscover()

0 comments on commit 8c1cfb2

Please sign in to comment.