Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

restore support of django 1.3 with USE_DJANGO_JQUERY == True #36

Open
wants to merge 1 commit into from

1 participant

@suvit

restore support of django 1.3 with USE_DJANGO_JQUERY == True

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 2, 2013
  1. @suvit
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 2 deletions.
  1. +5 −2 smart_selects/widgets.py
View
7 smart_selects/widgets.py
@@ -1,9 +1,7 @@
import django
from django.conf import settings
from django.forms.widgets import Select
-from django.contrib.admin.templatetags.admin_static import static
from django.core.urlresolvers import reverse
-from django.utils.encoding import iri_to_uri
from django.utils.safestring import mark_safe
from django.db.models import get_model
import locale
@@ -13,6 +11,11 @@
if django.VERSION >= (1, 2, 0) and getattr(settings,
'USE_DJANGO_JQUERY', True):
USE_DJANGO_JQUERY = True
+ try:
+ from django.contrib.admin.templatetags.admin_static import static
+ except ImportError:
+ def static(path):
+ return u"%s%s" % (settings.STATIC_URL, path)
else:
USE_DJANGO_JQUERY = False
JQUERY_URL = getattr(settings, 'JQUERY_URL', 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js')
Something went wrong with that request. Please try again.