Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #30447 - Added 'is_in_european_union' in GeoIP2.city() dict. #11327

Merged
merged 1 commit into from May 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions django/contrib/gis/geoip2/resources.py
Expand Up @@ -6,6 +6,7 @@ def City(response):
'country_code': response.country.iso_code,
'country_name': response.country.name,
'dma_code': response.location.metro_code,
'is_in_european_union': response.country.is_in_european_union,
'latitude': response.location.latitude,
'longitude': response.location.longitude,
'postal_code': response.postal.code,
Expand Down
1 change: 1 addition & 0 deletions docs/ref/contrib/gis/geoip2.txt
Expand Up @@ -38,6 +38,7 @@ Here is an example of its usage::
'country_code': 'US',
'country_name': 'United States',
'dma_code': 807,
'is_in_european_union': False,
'latitude': 37.419200897216797,
'longitude': -122.05740356445312,
'postal_code': '94043',
Expand Down
1 change: 1 addition & 0 deletions tests/gis_tests/test_geoip2.py
Expand Up @@ -127,6 +127,7 @@ def test04_city(self, gethostbyname):
self.assertEqual('Houston', d['city'])
self.assertEqual('TX', d['region'])
self.assertEqual('America/Chicago', d['time_zone'])
self.assertFalse(d['is_in_european_union'])
geom = g.geos(query)
self.assertIsInstance(geom, GEOSGeometry)

Expand Down