Skip to content

Commit

Permalink
Add helper.include_media = False for new version crisp-form.
Browse files Browse the repository at this point in the history
  • Loading branch information
sshwsfc committed Jul 7, 2016
1 parent 7de0e1b commit 24e42ba
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions xadmin/plugins/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ def get_context(self):
context = super(ChangePasswordView, self).get_context()
helper = FormHelper()
helper.form_tag = False
helper.include_media = False
self.form.helper = helper
context.update({
'title': _('Change password: %s') % escape(unicode(self.obj)),
Expand Down
1 change: 1 addition & 0 deletions xadmin/plugins/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def do_action(self, queryset):

helper = FormHelper()
helper.form_tag = False
helper.include_media = False
helper.add_layout(Layout(Container(Col('full',
Fieldset("", *self.form_obj.fields.keys(), css_class="unsort no_title"), horizontal=True, span=12)
)))
Expand Down
1 change: 1 addition & 0 deletions xadmin/plugins/editable.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def get(self, request, object_id):

helper = FormHelper()
helper.form_tag = False
helper.include_media = False
form.helper = helper

s = '{% load i18n crispy_forms_tags %}<form method="post" action="{{action_url}}">{% crispy form %}' + \
Expand Down
1 change: 1 addition & 0 deletions xadmin/plugins/inline.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ def instance_form(self, **kwargs):

helper = FormHelper()
helper.form_tag = False
helper.include_media = False
# override form method to prevent render csrf_token in inline forms, see template 'bootstrap/whole_uni_form.html'
helper.form_method = 'get'

Expand Down
2 changes: 2 additions & 0 deletions xadmin/views/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ def __init__(self, dashboard, data):
def setup(self):
helper = FormHelper()
helper.form_tag = False
helper.include_media = False
self.helper = helper

self.id = self.cleaned_data['id']
Expand Down Expand Up @@ -471,6 +472,7 @@ def setup(self):
def context(self, context):
helper = FormHelper()
helper.form_tag = False
helper.include_media = False

context.update({
'addform': self.add_view.form_obj,
Expand Down
1 change: 1 addition & 0 deletions xadmin/views/detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ def get_model_form(self, **kwargs):
def get_form_helper(self):
helper = FormHelper()
helper.form_tag = False
helper.include_media = False
layout = self.get_form_layout()
replace_field_to_value(layout, self.get_field_result)
helper.add_layout(layout)
Expand Down
1 change: 1 addition & 0 deletions xadmin/views/edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ def get_form_layout(self):
def get_form_helper(self):
helper = FormHelper()
helper.form_tag = False
helper.include_media = False
helper.add_layout(self.get_form_layout())

# deal with readonly fields
Expand Down
1 change: 1 addition & 0 deletions xadmin/views/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def get_form_layout(self):
def get_form_helper(self):
helper = FormHelper()
helper.form_tag = False
helper.include_media = False
helper.add_layout(self.get_form_layout())

return helper
Expand Down
1 change: 1 addition & 0 deletions xadmin/views/website.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def get(self, request, *args, **kwargs):
context = self.get_context()
helper = FormHelper()
helper.form_tag = False
helper.include_media = False
context.update({
'title': self.title,
'helper': helper,
Expand Down

0 comments on commit 24e42ba

Please sign in to comment.