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:
committed by
Tim Graham
parent
a3265af808
commit
e494b9ffb6
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user