Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
502f03d8
Kaydet (Commit)
502f03d8
authored
May 23, 2017
tarafından
R3turnz
Kaydeden (comit)
Tim Graham
May 23, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #28112 -- Added 'time_zone' in GeoIP2.city() dict.
üst
01f65864
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
1 deletion
+4
-1
resources.py
django/contrib/gis/geoip2/resources.py
+1
-0
geoip2.txt
docs/ref/contrib/gis/geoip2.txt
+2
-1
test_geoip2.py
tests/gis_tests/test_geoip2.py
+1
-0
No files found.
django/contrib/gis/geoip2/resources.py
Dosyayı görüntüle @
502f03d8
...
@@ -8,6 +8,7 @@ def City(response):
...
@@ -8,6 +8,7 @@ def City(response):
'longitude'
:
response
.
location
.
longitude
,
'longitude'
:
response
.
location
.
longitude
,
'postal_code'
:
response
.
postal
.
code
,
'postal_code'
:
response
.
postal
.
code
,
'region'
:
response
.
subdivisions
[
0
]
.
iso_code
if
len
(
response
.
subdivisions
)
else
None
,
'region'
:
response
.
subdivisions
[
0
]
.
iso_code
if
len
(
response
.
subdivisions
)
else
None
,
'time_zone'
:
response
.
location
.
time_zone
,
}
}
...
...
docs/ref/contrib/gis/geoip2.txt
Dosyayı görüntüle @
502f03d8
...
@@ -39,7 +39,8 @@ Here is an example of its usage::
...
@@ -39,7 +39,8 @@ Here is an example of its usage::
'latitude': 37.419200897216797,
'latitude': 37.419200897216797,
'longitude': -122.05740356445312,
'longitude': -122.05740356445312,
'postal_code': '94043',
'postal_code': '94043',
'region': 'CA'}
'region': 'CA',
'time_zone': 'America/Los_Angeles'}
>>> g.lat_lon('salon.com')
>>> g.lat_lon('salon.com')
(39.0437, -77.4875)
(39.0437, -77.4875)
>>> g.lon_lat('uh.edu')
>>> g.lon_lat('uh.edu')
...
...
tests/gis_tests/test_geoip2.py
Dosyayı görüntüle @
502f03d8
...
@@ -118,6 +118,7 @@ class GeoIPTest(unittest.TestCase):
...
@@ -118,6 +118,7 @@ class GeoIPTest(unittest.TestCase):
self
.
assertEqual
(
'US'
,
d
[
'country_code'
])
self
.
assertEqual
(
'US'
,
d
[
'country_code'
])
self
.
assertEqual
(
'Houston'
,
d
[
'city'
])
self
.
assertEqual
(
'Houston'
,
d
[
'city'
])
self
.
assertEqual
(
'TX'
,
d
[
'region'
])
self
.
assertEqual
(
'TX'
,
d
[
'region'
])
self
.
assertEqual
(
'America/Chicago'
,
d
[
'time_zone'
])
geom
=
g
.
geos
(
query
)
geom
=
g
.
geos
(
query
)
self
.
assertIsInstance
(
geom
,
GEOSGeometry
)
self
.
assertIsInstance
(
geom
,
GEOSGeometry
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment