1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #26509 -- Deprecated the contrib.gis.utils.precision_wkt() function.

This commit is contained in:
krishbharadwaj
2016-04-17 00:10:05 +05:30
committed by Tim Graham
parent a3265af808
commit e494b9ffb6
4 changed files with 38 additions and 0 deletions

View File

@@ -1,8 +1,10 @@
"""
Utilities for manipulating Geometry WKT.
"""
import warnings
from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning
def precision_wkt(geom, prec):
@@ -21,6 +23,11 @@ def precision_wkt(geom, prec):
If the precision is a string, it must be valid Python format string
(e.g., '%20.7f') -- thus, you should know what you're doing.
"""
warnings.warn(
"precision_wkt() is deprecated in favor of the WKTWriter class.",
RemovedInDjango20Warning, stacklevel=2
)
if isinstance(prec, int):
num_fmt = '%%.%df' % prec
elif isinstance(prec, six.string_types):