Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
flask-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
flask-admin
Commits
22853154
Commit
22853154
authored
Mar 15, 2013
by
Serge S. Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always use multipart/form-data for all forms. Allows using file fields in inline forms
parent
e06d55d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
form.py
flask_admin/form.py
+1
-0
lib.html
flask_admin/templates/admin/lib.html
+1
-1
No files found.
flask_admin/form.py
View file @
22853154
...
...
@@ -24,6 +24,7 @@ class BaseForm(wtf.Form):
def
has_file_field
(
self
):
"""
Return True if form contains at least one FileField.
Does not check for child form fields.
"""
# TODO: Optimize me
for
f
in
self
:
...
...
flask_admin/templates/admin/lib.html
View file @
22853154
...
...
@@ -114,7 +114,7 @@
{% endmacro %}
{% macro form_tag() %}
<form
action=
""
method=
"POST"
class=
"form-horizontal"
{%
if
form
.
has_file_field
%}
enctype=
"multipart/form-data"
{%
endif
%}
>
<form
action=
""
method=
"POST"
class=
"form-horizontal"
enctype=
"multipart/form-data"
>
<fieldset>
{{ caller() }}
</fieldset>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment