diff options
| author | Nick Pope <nick@nickpope.me.uk> | 2024-01-10 11:09:44 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-10 12:09:44 +0100 |
| commit | f50184a84b885f4474d5030af968195219a360b9 (patch) | |
| tree | 48dfc4aee1be6279b6e87822b0f7435eca7a0eab /docs | |
| parent | 9b02ad91ead3db75036be981bab2083aebc993a6 (diff) | |
Fixed #35092 -- Exposed extra fields for GeoIP2.country() and GeoIP2.city() responses.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/contrib/gis/geoip2.txt | 34 | ||||
| -rw-r--r-- | docs/releases/5.1.txt | 8 |
2 files changed, 29 insertions, 13 deletions
diff --git a/docs/ref/contrib/gis/geoip2.txt b/docs/ref/contrib/gis/geoip2.txt index 1d27e39657..2be6ea516c 100644 --- a/docs/ref/contrib/gis/geoip2.txt +++ b/docs/ref/contrib/gis/geoip2.txt @@ -33,20 +33,28 @@ Here is an example of its usage: >>> from django.contrib.gis.geoip2 import GeoIP2 >>> g = GeoIP2() >>> g.country("google.com") - {'country_code': 'US', 'country_name': 'United States'} + {'continent_code': 'NA', + 'continent_name': 'North America', + 'country_code': 'US', + 'country_name': 'United States', + 'is_in_european_union': False} >>> g.city("72.14.207.99") - {'city': 'Mountain View', - 'continent_code': 'NA', - 'continent_name': 'North America', - 'country_code': 'US', - 'country_name': 'United States', - 'dma_code': 807, - 'is_in_european_union': False, - 'latitude': 37.419200897216797, - 'longitude': -122.05740356445312, - 'postal_code': '94043', - 'region': 'CA', - 'time_zone': 'America/Los_Angeles'} + {'accuracy_radius': 1000, + 'city': 'Mountain View', + 'continent_code': 'NA', + 'continent_name': 'North America', + 'country_code': 'US', + 'country_name': 'United States', + 'is_in_european_union': False, + 'latitude': 37.419200897216797, + 'longitude': -122.05740356445312, + 'metro_code': 807, + 'postal_code': '94043', + 'region_code': 'CA', + 'region_name': 'California', + 'time_zone': 'America/Los_Angeles', + 'dma_code': 807, + 'region': 'CA'} >>> g.lat_lon("salon.com") (39.0437, -77.4875) >>> g.lon_lat("uh.edu") diff --git a/docs/releases/5.1.txt b/docs/releases/5.1.txt index d458811471..547a38d0b4 100644 --- a/docs/releases/5.1.txt +++ b/docs/releases/5.1.txt @@ -62,6 +62,14 @@ Minor features * :class:`~django.contrib.gis.geoip2.GeoIP2` now allows querying using :class:`ipaddress.IPv4Address` or :class:`ipaddress.IPv6Address` objects. +* :meth:`.GeoIP2.country` now exposes the ``continent_code``, + ``continent_name``, and ``is_in_european_union`` values. + +* :meth:`.GeoIP2.city` now exposes the ``accuracy_radius`` and ``region_name`` + values. In addition the ``dma_code`` and ``region`` values are now exposed as + ``metro_code`` and ``region_code``, but the previous keys are also retained + for backward compatibility. + :mod:`django.contrib.messages` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
