Skip to content

Commit

Permalink
make it possible to use complex widget in admincommand forms
Browse files Browse the repository at this point in the history
  • Loading branch information
amirouche committed Jul 9, 2012
1 parent e823b0d commit 05a6bc5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions admincommand/admin.py
Expand Up @@ -9,6 +9,7 @@
from django.utils.encoding import force_unicode
from django.utils.functional import update_wrapper
from django.http import HttpResponseForbidden
from django.utils.safestring import mark_safe

from sneak.admin import SneakAdmin

Expand Down Expand Up @@ -83,6 +84,7 @@ def run_command_view(self, request, url_name):
ctx['form'] = form
else:
ctx['form'] = admin_command.form()
ctx['media'] = mark_safe(ctx['form'].media.render())
return render(request, 'admincommand/run.html', ctx)

def command_name(self, obj):
Expand Down
5 changes: 4 additions & 1 deletion admincommand/templates/admincommand/run.html
Expand Up @@ -3,8 +3,11 @@
{% load i18n %}

{% block extrahead %}
<link href="{{ STATIC_URL }}/admin/css/base.css" type="text/css" media="all" rel="stylesheet" />
<link href="{{ STATIC_URL }}/admin/css/forms.css" type="text/css" media="all" rel="stylesheet" />
<link href="{{ STATIC_URL }}/admin/css/widgets.css" type="text/css" media="all" rel="stylesheet" />
<script type="text/javascript" src="{{ STATIC_URL }}/admin/js/core.js"></script>
{{ block.super }}
<script type="text/javascript" src="{{ STATIC_URL }}libe/js/jquery.js"></script>
{% endblock %}

{% block breadcrumbs %}
Expand Down

0 comments on commit 05a6bc5

Please sign in to comment.