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
f3bf0722
Commit
f3bf0722
authored
Aug 05, 2013
by
Serge S. Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor cleanup
parent
ab501acb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
upload.py
flask_admin/form/upload.py
+7
-5
No files found.
flask_admin/form/upload.py
View file @
f3bf0722
...
@@ -85,11 +85,7 @@ class ImageUploadInput(object):
...
@@ -85,11 +85,7 @@ class ImageUploadInput(object):
}
}
if
field
.
data
and
isinstance
(
field
.
data
,
string_types
):
if
field
.
data
and
isinstance
(
field
.
data
,
string_types
):
if
field
.
thumbnail_size
:
url
=
self
.
get_url
()
url
=
url_for
(
field
.
endpoint
,
filename
=
field
.
thumbnail_fn
(
field
.
data
))
else
:
url
=
url_for
(
field
.
endpoint
,
filename
=
field
.
data
)
args
[
'image'
]
=
html_params
(
src
=
url
)
args
[
'image'
]
=
html_params
(
src
=
url
)
template
=
self
.
data_template
template
=
self
.
data_template
...
@@ -98,6 +94,12 @@ class ImageUploadInput(object):
...
@@ -98,6 +94,12 @@ class ImageUploadInput(object):
return
HTMLString
(
template
%
args
)
return
HTMLString
(
template
%
args
)
def
get_url
(
self
,
field
):
if
field
.
thumbnail_size
:
return
url_for
(
field
.
endpoint
,
filename
=
field
.
thumbnail_fn
(
field
.
data
))
return
url_for
(
field
.
endpoint
,
filename
=
field
.
data
)
# Fields
# Fields
class
FileUploadField
(
fields
.
TextField
):
class
FileUploadField
(
fields
.
TextField
):
...
...
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