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
6e333212
Commit
6e333212
authored
Dec 07, 2014
by
Alex Kerney
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wasn't correctly handling when there was no data
parent
0d565dac
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
fields.py
flask_admin/contrib/geoa/fields.py
+4
-2
No files found.
flask_admin/contrib/geoa/fields.py
View file @
6e333212
...
...
@@ -4,6 +4,7 @@ from shapely.geometry import shape, mapping
from
.widgets
import
LeafletWidget
from
sqlalchemy
import
func
import
geoalchemy2
from
types
import
NoneType
#from .. import db how do you get db.session in a Field?
...
...
@@ -60,6 +61,7 @@ class GeoJSONField(JSONField):
def
process_formdata
(
self
,
valuelist
):
super
(
GeoJSONField
,
self
)
.
process_formdata
(
valuelist
)
print
type
(
self
.
data
)
if
type
(
self
.
data
)
is
not
NoneType
:
web_shape
=
self
.
session
.
scalar
(
func
.
ST_AsText
(
func
.
ST_Transform
(
func
.
ST_GeomFromText
(
shape
(
self
.
data
)
.
wkt
,
self
.
web_srid
),
self
.
transform_srid
)))
if
type
(
self
.
data
):
self
.
data
=
'SRID='
+
str
(
self
.
srid
)
+
';'
+
str
(
web_shape
)
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