mirror of https://github.com/django/django.git
Refs #25665 -- Removed GEOSGeometry.get/set_srid() per deprecation timeline.
This commit is contained in:
parent
ed251246cc
commit
a0149848f7
|
@ -5,7 +5,6 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import json
|
||||
import warnings
|
||||
from ctypes import addressof, byref, c_double
|
||||
|
||||
from django.contrib.gis import gdal
|
||||
|
@ -22,7 +21,6 @@ from django.contrib.gis.geos.prototypes.io import (
|
|||
)
|
||||
from django.utils import six
|
||||
from django.utils.deconstruct import deconstructible
|
||||
from django.utils.deprecation import RemovedInDjango20Warning
|
||||
from django.utils.encoding import force_bytes, force_text
|
||||
|
||||
|
||||
|
@ -385,20 +383,6 @@ class GEOSGeometry(GEOSBase, ListMixin):
|
|||
"Sets the SRID for the geometry."
|
||||
capi.geos_set_srid(self.ptr, 0 if srid is None else srid)
|
||||
|
||||
def get_srid(self):
|
||||
warnings.warn(
|
||||
"`get_srid()` is deprecated, use the `srid` property instead.",
|
||||
RemovedInDjango20Warning, 2
|
||||
)
|
||||
return self.srid
|
||||
|
||||
def set_srid(self, srid):
|
||||
warnings.warn(
|
||||
"`set_srid()` is deprecated, use the `srid` property instead.",
|
||||
RemovedInDjango20Warning, 2
|
||||
)
|
||||
self.srid = srid
|
||||
|
||||
# #### Output Routines ####
|
||||
@property
|
||||
def ewkt(self):
|
||||
|
|
|
@ -324,3 +324,6 @@ these features.
|
|||
|
||||
* Support for direct assignment to a reverse foreign key or many-to-many
|
||||
relation is removed.
|
||||
|
||||
* The ``get_srid()`` and ``set_srid()`` methods of
|
||||
``django.contrib.gis.geos.GEOSGeometry`` are removed.
|
||||
|
|
|
@ -1316,14 +1316,6 @@ class GEOSTest(SimpleTestCase, TestDataMixin):
|
|||
p.transform(2774)
|
||||
self.assertEqual(p, Point(srid=2774))
|
||||
|
||||
@ignore_warnings(category=RemovedInDjango20Warning)
|
||||
def test_deprecated_srid_getters_setters(self):
|
||||
p = Point(1, 2, srid=123)
|
||||
self.assertEqual(p.get_srid(), p.srid)
|
||||
|
||||
p.set_srid(321)
|
||||
self.assertEqual(p.srid, 321)
|
||||
|
||||
@ignore_warnings(category=RemovedInDjango20Warning)
|
||||
def test_deprecated_point_coordinate_getters_setters(self):
|
||||
p = Point(1, 2, 3)
|
||||
|
|
Loading…
Reference in New Issue