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
fd1ba074
Commit
fd1ba074
authored
Dec 08, 2014
by
Alex Kerney
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Using is not None instead of type is not NoneType to make Python 3 happy.
parent
c359103d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
fields.py
flask_admin/contrib/geoa/fields.py
+2
-2
No files found.
flask_admin/contrib/geoa/fields.py
View file @
fd1ba074
...
@@ -4,7 +4,7 @@ from shapely.geometry import shape, mapping
...
@@ -4,7 +4,7 @@ from shapely.geometry import shape, mapping
from
.widgets
import
LeafletWidget
from
.widgets
import
LeafletWidget
from
sqlalchemy
import
func
from
sqlalchemy
import
func
import
geoalchemy2
import
geoalchemy2
from
types
import
NoneType
#
from types import NoneType
#from .. import db how do you get db.session in a Field?
#from .. import db how do you get db.session in a Field?
...
@@ -63,6 +63,6 @@ class GeoJSONField(JSONField):
...
@@ -63,6 +63,6 @@ class GeoJSONField(JSONField):
super
(
GeoJSONField
,
self
)
.
process_formdata
(
valuelist
)
super
(
GeoJSONField
,
self
)
.
process_formdata
(
valuelist
)
if
str
(
self
.
data
)
is
''
:
if
str
(
self
.
data
)
is
''
:
self
.
data
=
None
self
.
data
=
None
if
type
(
self
.
data
)
is
not
NoneTyp
e
:
if
self
.
data
is
not
Non
e
:
web_shape
=
self
.
session
.
scalar
(
func
.
ST_AsText
(
func
.
ST_Transform
(
func
.
ST_GeomFromText
(
shape
(
self
.
data
)
.
wkt
,
self
.
web_srid
),
self
.
transform_srid
)))
web_shape
=
self
.
session
.
scalar
(
func
.
ST_AsText
(
func
.
ST_Transform
(
func
.
ST_GeomFromText
(
shape
(
self
.
data
)
.
wkt
,
self
.
web_srid
),
self
.
transform_srid
)))
self
.
data
=
'SRID='
+
str
(
self
.
srid
)
+
';'
+
str
(
web_shape
)
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