diff options
| author | Sergey Fedoseev <fedoseev.sergey@gmail.com> | 2015-11-05 10:37:51 +0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-11-18 12:06:03 -0500 |
| commit | 7a452c5ce295679307bd81dd9b5f37b3cf762acf (patch) | |
| tree | 5471571f67f48aadbe31478e1491b13bc8f63fde /django | |
| parent | 7803f429a4d435623cb7b91dd324d3aadad87380 (diff) | |
Fixed #25665 -- Deprecated getter/setter of Point.tuple.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/gis/geos/point.py | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/django/contrib/gis/geos/point.py b/django/contrib/gis/geos/point.py index beccfb0af5..34a955e924 100644 --- a/django/contrib/gis/geos/point.py +++ b/django/contrib/gis/geos/point.py @@ -172,14 +172,29 @@ class Point(GEOSGeometry): self.z = value # ### Tuple setting and retrieval routines. ### - def get_coords(self): + @property + def tuple(self): "Returns a tuple of the point." return self._cs.tuple - def set_coords(self, tup): + @tuple.setter + def tuple(self, tup): "Sets the coordinates of the point with the given tuple." self._cs[0] = tup + def get_coords(self): + warnings.warn( + "`get_coords()` is deprecated, use the `tuple` property instead.", + RemovedInDjango20Warning, 2 + ) + return self.tuple + + def set_coords(self, tup): + warnings.warn( + "`set_coords()` is deprecated, use the `tuple` property instead.", + RemovedInDjango20Warning, 2 + ) + self.tuple = tup + # The tuple and coords properties - tuple = property(get_coords, set_coords) coords = tuple |
