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
a850544e
Commit
a850544e
authored
Aug 25, 2012
by
Serge S. Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed #27
parent
75f09a80
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
fileadmin.py
flask_admin/contrib/fileadmin.py
+9
-1
No files found.
flask_admin/contrib/fileadmin.py
View file @
a850544e
...
...
@@ -132,7 +132,8 @@ class FileAdmin(BaseView, ActionsMixin):
"""
def
__init__
(
self
,
base_path
,
base_url
,
name
=
None
,
category
=
None
,
endpoint
=
None
,
url
=
None
):
name
=
None
,
category
=
None
,
endpoint
=
None
,
url
=
None
,
verify_path
=
True
):
"""
Constructor.
...
...
@@ -148,6 +149,9 @@ class FileAdmin(BaseView, ActionsMixin):
Endpoint name for the view
`url`
URL for view
`verify_path`
Verify if path exists. If set to `True` and path does not exist
will throw exception.
"""
self
.
base_path
=
base_path
self
.
base_url
=
base_url
...
...
@@ -161,6 +165,10 @@ class FileAdmin(BaseView, ActionsMixin):
and
not
isinstance
(
self
.
allowed_extensions
,
set
)):
self
.
allowed_extensions
=
set
(
self
.
allowed_extensions
)
# Check if path exists
if
not
op
.
exists
(
base_path
):
raise
IOError
(
'FileAdmin path "
%
s" does not exist or is not accessible'
%
base_path
)
super
(
FileAdmin
,
self
)
.
__init__
(
name
,
category
,
endpoint
,
url
)
def
is_accessible_path
(
self
,
path
):
...
...
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