Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 1.4 compatability and more #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions admin_jqueryui/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
from django.contrib.admin.options import ModelAdmin
try:
from django.contrib.staticfiles.templatetags.staticfiles import static
except ImportError:
static = lambda path: path

old_media = ModelAdmin._media

ModelAdmin.old_media = ModelAdmin.media

def new_media(self):
media_instance = old_media(self)
media_instance = self.old_media
media_instance.add_js(('admin_jqueryui/js/admin_jqueryui.min.js',))
return media_instance

ModelAdmin.media = property(new_media)
Loading