Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Replaced some dicts with sets.

  • Loading branch information...
commit df3d7e66daedc2d4be8b7ca2f5046ac80e0297f8 1 parent 5ac7f77
Alex Gaynor alex authored
2  django/contrib/gis/db/backends/oracle/operations.py
View
@@ -78,7 +78,7 @@ class OracleOperations(DatabaseOperations, BaseSpatialOperations):
name = 'oracle'
oracle = True
- valid_aggregates = dict([(a, None) for a in ('Union', 'Extent')])
+ valid_aggregates = {'Union', 'Extent'}
Adapter = OracleSpatialAdapter
Adaptor = Adapter # Backwards-compatibility alias.
4 django/contrib/gis/db/backends/postgis/operations.py
View
@@ -56,6 +56,7 @@ class PostGISSphereDistance(PostGISDistance):
class PostGISRelate(PostGISFunctionParam):
"For PostGIS Relate(<geom>, <pattern>) calls."
pattern_regex = re.compile(r'^[012TF\*]{9}$')
+
def __init__(self, prefix, pattern):
if not self.pattern_regex.match(pattern):
raise ValueError('Invalid intersection matrix pattern "%s".' % pattern)
@@ -68,8 +69,7 @@ class PostGISOperations(DatabaseOperations, BaseSpatialOperations):
postgis = True
geom_func_prefix = 'ST_'
version_regex = re.compile(r'^(?P<major>\d)\.(?P<minor1>\d)\.(?P<minor2>\d+)')
- valid_aggregates = dict([(k, None) for k in
- ('Collect', 'Extent', 'Extent3D', 'MakeLine', 'Union')])
+ valid_aggregates = {'Collect', 'Extent', 'Extent3D', 'MakeLine', 'Union'}
Adapter = PostGISAdapter
Adaptor = Adapter # Backwards-compatibility alias.
2  django/contrib/gis/db/backends/spatialite/operations.py
View
@@ -56,7 +56,7 @@ class SpatiaLiteOperations(DatabaseOperations, BaseSpatialOperations):
name = 'spatialite'
spatialite = True
version_regex = re.compile(r'^(?P<major>\d)\.(?P<minor1>\d)\.(?P<minor2>\d+)')
- valid_aggregates = dict([(k, None) for k in ('Extent', 'Union')])
+ valid_aggregates = {'Extent', 'Union'}
Adapter = SpatiaLiteAdapter
Adaptor = Adapter # Backwards-compatibility alias.
Please sign in to comment.
Something went wrong with that request. Please try again.