Loading django/contrib/gis/admin/options.py +1 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ class GeoModelAdmin(ModelAdmin): 'num_zoom' : self.num_zoom, 'max_zoom' : self.max_zoom, 'min_zoom' : self.min_zoom, 'units' : self.units, #likely shoud get from object 'units' : self.units, # likely should get from object 'max_resolution' : self.max_resolution, 'max_extent' : self.max_extent, 'modifiable' : self.modifiable, Loading django/contrib/gis/gdal/srs.py +1 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,7 @@ class SpatialReference(GDALBase): doesn't exist. Can also take a tuple as a parameter, (target, child), where child is the index of the attribute in the WKT. For example: >>> wkt = 'GEOGCS["WGS 84", DATUM["WGS_1984, ... AUTHORITY["EPSG","4326"]]') >>> wkt = 'GEOGCS["WGS 84", DATUM["WGS_1984, ... AUTHORITY["EPSG","4326"]]' >>> srs = SpatialReference(wkt) # could also use 'WGS84', or 4326 >>> print(srs['GEOGCS']) WGS 84 Loading django/contrib/gis/geos/polygon.py +4 −2 Original line number Diff line number Diff line Loading @@ -17,12 +17,14 @@ class Polygon(GEOSGeometry): Examples of initialization, where shell, hole1, and hole2 are valid LinearRing geometries: >>> from django.contrib.gis.geos import LinearRing, Polygon >>> shell = hole1 = hole2 = LinearRing() >>> poly = Polygon(shell, hole1, hole2) >>> poly = Polygon(shell, (hole1, hole2)) Example where a tuple parameters are used: >>> # Example where a tuple parameters are used: >>> poly = Polygon(((0, 0), (0, 10), (10, 10), (0, 10), (0, 0)), ((4, 4), (4, 6), (6, 6), (6, 4), (4, 4))) ... ((4, 4), (4, 6), (6, 6), (6, 4), (4, 4))) """ if not args: raise TypeError('Must provide at least one LinearRing, or a tuple, to initialize a Polygon.') Loading django/contrib/gis/geos/tests/test_mutable_list.py +6 −3 Original line number Diff line number Diff line Loading @@ -16,11 +16,14 @@ class UserListA(ListMixin): self._list = self._mytype(i_list) super(UserListA, self).__init__(*args, **kwargs) def __len__(self): return len(self._list) def __len__(self): return len(self._list) def __str__(self): return str(self._list) def __str__(self): return str(self._list) def __repr__(self): return repr(self._list) def __repr__(self): return repr(self._list) def _set_list(self, length, items): # this would work: Loading django/contrib/gis/tests/layermap/tests.py +4 −2 Original line number Diff line number Diff line Loading @@ -163,8 +163,10 @@ class LayerMapTest(TestCase): # Passing in invalid ForeignKey mapping parameters -- must be a dictionary # mapping for the model the ForeignKey points to. bad_fk_map1 = copy(co_mapping); bad_fk_map1['state'] = 'name' bad_fk_map2 = copy(co_mapping); bad_fk_map2['state'] = {'nombre' : 'State'} bad_fk_map1 = copy(co_mapping) bad_fk_map1['state'] = 'name' bad_fk_map2 = copy(co_mapping) bad_fk_map2['state'] = {'nombre' : 'State'} self.assertRaises(TypeError, LayerMapping, County, co_shp, bad_fk_map1, transform=False) self.assertRaises(LayerMapError, LayerMapping, County, co_shp, bad_fk_map2, transform=False) Loading Loading
django/contrib/gis/admin/options.py +1 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ class GeoModelAdmin(ModelAdmin): 'num_zoom' : self.num_zoom, 'max_zoom' : self.max_zoom, 'min_zoom' : self.min_zoom, 'units' : self.units, #likely shoud get from object 'units' : self.units, # likely should get from object 'max_resolution' : self.max_resolution, 'max_extent' : self.max_extent, 'modifiable' : self.modifiable, Loading
django/contrib/gis/gdal/srs.py +1 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,7 @@ class SpatialReference(GDALBase): doesn't exist. Can also take a tuple as a parameter, (target, child), where child is the index of the attribute in the WKT. For example: >>> wkt = 'GEOGCS["WGS 84", DATUM["WGS_1984, ... AUTHORITY["EPSG","4326"]]') >>> wkt = 'GEOGCS["WGS 84", DATUM["WGS_1984, ... AUTHORITY["EPSG","4326"]]' >>> srs = SpatialReference(wkt) # could also use 'WGS84', or 4326 >>> print(srs['GEOGCS']) WGS 84 Loading
django/contrib/gis/geos/polygon.py +4 −2 Original line number Diff line number Diff line Loading @@ -17,12 +17,14 @@ class Polygon(GEOSGeometry): Examples of initialization, where shell, hole1, and hole2 are valid LinearRing geometries: >>> from django.contrib.gis.geos import LinearRing, Polygon >>> shell = hole1 = hole2 = LinearRing() >>> poly = Polygon(shell, hole1, hole2) >>> poly = Polygon(shell, (hole1, hole2)) Example where a tuple parameters are used: >>> # Example where a tuple parameters are used: >>> poly = Polygon(((0, 0), (0, 10), (10, 10), (0, 10), (0, 0)), ((4, 4), (4, 6), (6, 6), (6, 4), (4, 4))) ... ((4, 4), (4, 6), (6, 6), (6, 4), (4, 4))) """ if not args: raise TypeError('Must provide at least one LinearRing, or a tuple, to initialize a Polygon.') Loading
django/contrib/gis/geos/tests/test_mutable_list.py +6 −3 Original line number Diff line number Diff line Loading @@ -16,11 +16,14 @@ class UserListA(ListMixin): self._list = self._mytype(i_list) super(UserListA, self).__init__(*args, **kwargs) def __len__(self): return len(self._list) def __len__(self): return len(self._list) def __str__(self): return str(self._list) def __str__(self): return str(self._list) def __repr__(self): return repr(self._list) def __repr__(self): return repr(self._list) def _set_list(self, length, items): # this would work: Loading
django/contrib/gis/tests/layermap/tests.py +4 −2 Original line number Diff line number Diff line Loading @@ -163,8 +163,10 @@ class LayerMapTest(TestCase): # Passing in invalid ForeignKey mapping parameters -- must be a dictionary # mapping for the model the ForeignKey points to. bad_fk_map1 = copy(co_mapping); bad_fk_map1['state'] = 'name' bad_fk_map2 = copy(co_mapping); bad_fk_map2['state'] = {'nombre' : 'State'} bad_fk_map1 = copy(co_mapping) bad_fk_map1['state'] = 'name' bad_fk_map2 = copy(co_mapping) bad_fk_map2['state'] = {'nombre' : 'State'} self.assertRaises(TypeError, LayerMapping, County, co_shp, bad_fk_map1, transform=False) self.assertRaises(LayerMapError, LayerMapping, County, co_shp, bad_fk_map2, transform=False) Loading