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
1303e12c
Commit
1303e12c
authored
Jun 22, 2019
by
waylon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix E117,F632 after pydocestyle update.
parent
b0e09ea4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
fields.py
flask_admin/contrib/geoa/fields.py
+3
-3
typefmt.py
flask_admin/contrib/geoa/typefmt.py
+1
-1
view.py
flask_admin/contrib/mongoengine/view.py
+2
-2
view.py
flask_admin/contrib/peewee/view.py
+2
-2
No files found.
flask_admin/contrib/geoa/fields.py
View file @
1303e12c
...
@@ -19,7 +19,7 @@ class GeoJSONField(JSONField):
...
@@ -19,7 +19,7 @@ class GeoJSONField(JSONField):
super
(
GeoJSONField
,
self
)
.
__init__
(
label
,
validators
,
**
kwargs
)
super
(
GeoJSONField
,
self
)
.
__init__
(
label
,
validators
,
**
kwargs
)
self
.
web_srid
=
4326
self
.
web_srid
=
4326
self
.
srid
=
srid
self
.
srid
=
srid
if
self
.
srid
is
-
1
:
if
self
.
srid
==
-
1
:
self
.
transform_srid
=
self
.
web_srid
self
.
transform_srid
=
self
.
web_srid
else
:
else
:
self
.
transform_srid
=
self
.
srid
self
.
transform_srid
=
self
.
srid
...
@@ -30,7 +30,7 @@ class GeoJSONField(JSONField):
...
@@ -30,7 +30,7 @@ class GeoJSONField(JSONField):
if
self
.
raw_data
:
if
self
.
raw_data
:
return
self
.
raw_data
[
0
]
return
self
.
raw_data
[
0
]
if
type
(
self
.
data
)
is
geoalchemy2
.
elements
.
WKBElement
:
if
type
(
self
.
data
)
is
geoalchemy2
.
elements
.
WKBElement
:
if
self
.
srid
is
-
1
:
if
self
.
srid
==
-
1
:
return
self
.
session
.
scalar
(
func
.
ST_AsGeoJson
(
self
.
data
))
return
self
.
session
.
scalar
(
func
.
ST_AsGeoJson
(
self
.
data
))
else
:
else
:
return
self
.
session
.
scalar
(
return
self
.
session
.
scalar
(
...
@@ -43,7 +43,7 @@ class GeoJSONField(JSONField):
...
@@ -43,7 +43,7 @@ class GeoJSONField(JSONField):
def
process_formdata
(
self
,
valuelist
):
def
process_formdata
(
self
,
valuelist
):
super
(
GeoJSONField
,
self
)
.
process_formdata
(
valuelist
)
super
(
GeoJSONField
,
self
)
.
process_formdata
(
valuelist
)
if
str
(
self
.
data
)
is
''
:
if
str
(
self
.
data
)
==
''
:
self
.
data
=
None
self
.
data
=
None
if
self
.
data
is
not
None
:
if
self
.
data
is
not
None
:
web_shape
=
self
.
session
.
scalar
(
web_shape
=
self
.
session
.
scalar
(
...
...
flask_admin/contrib/geoa/typefmt.py
View file @
1303e12c
...
@@ -17,7 +17,7 @@ def geom_formatter(view, value):
...
@@ -17,7 +17,7 @@ def geom_formatter(view, value):
"data-tile-layer-url"
:
view
.
tile_layer_url
,
"data-tile-layer-url"
:
view
.
tile_layer_url
,
"data-tile-layer-attribution"
:
view
.
tile_layer_attribution
"data-tile-layer-attribution"
:
view
.
tile_layer_attribution
})
})
if
value
.
srid
is
-
1
:
if
value
.
srid
==
-
1
:
value
.
srid
=
4326
value
.
srid
=
4326
geojson
=
view
.
session
.
query
(
view
.
model
)
.
with_entities
(
func
.
ST_AsGeoJSON
(
value
))
.
scalar
()
geojson
=
view
.
session
.
query
(
view
.
model
)
.
with_entities
(
func
.
ST_AsGeoJSON
(
value
))
.
scalar
()
return
Markup
(
'<textarea
%
s>
%
s</textarea>'
%
(
params
,
geojson
))
return
Markup
(
'<textarea
%
s>
%
s</textarea>'
%
(
params
,
geojson
))
...
...
flask_admin/contrib/mongoengine/view.py
View file @
1303e12c
...
@@ -363,8 +363,8 @@ class ModelView(BaseModelView):
...
@@ -363,8 +363,8 @@ class ModelView(BaseModelView):
# Check type
# Check type
if
(
field_type
not
in
self
.
allowed_search_types
):
if
(
field_type
not
in
self
.
allowed_search_types
):
raise
Exception
(
'Can only search on text columns. '
+
raise
Exception
(
'Can only search on text columns. '
+
'Failed to setup search for "
%
s"'
%
p
)
'Failed to setup search for "
%
s"'
%
p
)
self
.
_search_fields
.
append
(
p
)
self
.
_search_fields
.
append
(
p
)
...
...
flask_admin/contrib/peewee/view.py
View file @
1303e12c
...
@@ -217,8 +217,8 @@ class ModelView(BaseModelView):
...
@@ -217,8 +217,8 @@ class ModelView(BaseModelView):
# Check type
# Check type
if
not
isinstance
(
p
,
(
CharField
,
TextField
)):
if
not
isinstance
(
p
,
(
CharField
,
TextField
)):
raise
Exception
(
'Can only search on text columns. '
+
raise
Exception
(
'Can only search on text columns. '
+
'Failed to setup search for "
%
s"'
%
p
)
'Failed to setup search for "
%
s"'
%
p
)
self
.
_search_fields
.
append
(
p
)
self
.
_search_fields
.
append
(
p
)
...
...
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