Commit b2d20e98 authored by Aymeric Augustin's avatar Aymeric Augustin
Browse files

Removed legacy shortcut for importing GeoIP.

parent d4ea02b9
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -14,12 +14,4 @@ if HAS_GDAL:
    except:
        pass

# GeoIP now lives in `django.contrib.gis.geoip`; this shortcut will be
# removed in Django 1.6.
from django.contrib.gis.utils import geoip
HAS_GEOIP = geoip.HAS_GEOIP
if HAS_GEOIP:
    GeoIP = geoip.GeoIP
    GeoIPException = geoip.GeoIPException

from django.contrib.gis.utils.wkt import precision_wkt

django/contrib/gis/utils/geoip.py

deleted100644 → 0
+0 −14
Original line number Diff line number Diff line
import warnings

from django.contrib.gis import geoip
HAS_GEOIP = geoip.HAS_GEOIP
if HAS_GEOIP:
    BaseGeoIP = geoip.GeoIP
    GeoIPException = geoip.GeoIPException

    class GeoIP(BaseGeoIP):
        def __init__(self, *args, **kwargs):
            warnings.warn('GeoIP class has been moved to `django.contrib.gis.geoip`, and '
                          'this shortcut will disappear in Django v1.6.',
                          DeprecationWarning, stacklevel=2)
            super(GeoIP, self).__init__(*args, **kwargs)
+21 −30
Original line number Diff line number Diff line
@@ -7,15 +7,6 @@ Geolocation with GeoIP
.. module:: django.contrib.gis.geoip
   :synopsis: High-level Python interface for MaxMind's GeoIP C library.

.. versionchanged:: 1.4

.. note::

    In Django 1.4, the :class:`GeoIP` object was moved out of
    :mod:`django.contrib.gis.utils` and into its own module, 
    :mod:`django.contrib.gis.geoip`. A shortcut is still provided
    in ``utils``, but will be removed in Django 1.6.

The :class:`GeoIP` object is a ctypes wrapper for the
`MaxMind GeoIP C API`__. [#]_  This interface is a BSD-licensed alternative
to the GPL-licensed `Python GeoIP`__ interface provided by MaxMind.