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
49fb3f5f
Kaydet (Commit)
49fb3f5f
authored
Nis 08, 2019
tarafından
Dustin Neighly
Kaydeden (comit)
Mariusz Felisiak
Nis 19, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #30341 -- Added support for the furlong unit in Distance.
üst
753580ec
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
1 deletion
+12
-1
measure.py
django/contrib/gis/measure.py
+2
-0
measure.txt
docs/ref/contrib/gis/measure.txt
+1
-0
3.0.txt
docs/releases/3.0.txt
+3
-0
test_measure.py
tests/gis_tests/test_measure.py
+6
-1
No files found.
django/contrib/gis/measure.py
Dosyayı görüntüle @
49fb3f5f
...
@@ -233,6 +233,7 @@ class Distance(MeasureBase):
...
@@ -233,6 +233,7 @@ class Distance(MeasureBase):
'clarke_link'
:
0.201166195164
,
'clarke_link'
:
0.201166195164
,
'fathom'
:
1.8288
,
'fathom'
:
1.8288
,
'ft'
:
0.3048
,
'ft'
:
0.3048
,
'furlong'
:
201.168
,
'german_m'
:
1.0000135965
,
'german_m'
:
1.0000135965
,
'gold_coast_ft'
:
0.304799710181508
,
'gold_coast_ft'
:
0.304799710181508
,
'indian_yd'
:
0.914398530744
,
'indian_yd'
:
0.914398530744
,
...
@@ -280,6 +281,7 @@ class Distance(MeasureBase):
...
@@ -280,6 +281,7 @@ class Distance(MeasureBase):
'Chain (Benoit)'
:
'chain_benoit'
,
'Chain (Benoit)'
:
'chain_benoit'
,
'Chain (Sears)'
:
'chain_sears'
,
'Chain (Sears)'
:
'chain_sears'
,
'Foot (International)'
:
'ft'
,
'Foot (International)'
:
'ft'
,
'Furrow Long'
:
'furlong'
,
'German legal metre'
:
'german_m'
,
'German legal metre'
:
'german_m'
,
'Gold Coast foot'
:
'gold_coast_ft'
,
'Gold Coast foot'
:
'gold_coast_ft'
,
'Indian yard'
:
'indian_yd'
,
'Indian yard'
:
'indian_yd'
,
...
...
docs/ref/contrib/gis/measure.txt
Dosyayı görüntüle @
49fb3f5f
...
@@ -93,6 +93,7 @@ Unit Attribute Full name or alias(es)
...
@@ -93,6 +93,7 @@ Unit Attribute Full name or alias(es)
``clarke_link`` Clarke's link
``clarke_link`` Clarke's link
``fathom`` Fathom
``fathom`` Fathom
``rod`` Rod
``rod`` Rod
``furlong`` Furlong, Furrow Long
``nm`` Nautical Mile
``nm`` Nautical Mile
``nm_uk`` Nautical Mile (UK)
``nm_uk`` Nautical Mile (UK)
``german_m`` German legal metre
``german_m`` German legal metre
...
...
docs/releases/3.0.txt
Dosyayı görüntüle @
49fb3f5f
...
@@ -75,6 +75,9 @@ Minor features
...
@@ -75,6 +75,9 @@ Minor features
* Added the :class:`~django.contrib.gis.db.models.functions.GeometryDistance`
* Added the :class:`~django.contrib.gis.db.models.functions.GeometryDistance`
function, supported on PostGIS.
function, supported on PostGIS.
* Added support for the ``furlong`` unit in
:class:`~django.contrib.gis.measure.Distance`.
:mod:`django.contrib.messages`
:mod:`django.contrib.messages`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
...
tests/gis_tests/test_measure.py
Dosyayı görüntüle @
49fb3f5f
...
@@ -138,10 +138,15 @@ class DistanceTest(unittest.TestCase):
...
@@ -138,10 +138,15 @@ class DistanceTest(unittest.TestCase):
self
.
assertEqual
(
repr
(
d1
),
'Distance(m=100.0)'
)
self
.
assertEqual
(
repr
(
d1
),
'Distance(m=100.0)'
)
self
.
assertEqual
(
repr
(
d2
),
'Distance(km=3.5)'
)
self
.
assertEqual
(
repr
(
d2
),
'Distance(km=3.5)'
)
def
test_furlong
(
self
):
d
=
D
(
m
=
201.168
)
self
.
assertEqual
(
d
.
furlong
,
1
)
def
test_unit_att_name
(
self
):
def
test_unit_att_name
(
self
):
"Testing the `unit_attname` class method"
"Testing the `unit_attname` class method"
unit_tuple
=
[(
'Yard'
,
'yd'
),
(
'Nautical Mile'
,
'nm'
),
(
'German legal metre'
,
'german_m'
),
unit_tuple
=
[(
'Yard'
,
'yd'
),
(
'Nautical Mile'
,
'nm'
),
(
'German legal metre'
,
'german_m'
),
(
'Indian yard'
,
'indian_yd'
),
(
'Chain (Sears)'
,
'chain_sears'
),
(
'Chain'
,
'chain'
)]
(
'Indian yard'
,
'indian_yd'
),
(
'Chain (Sears)'
,
'chain_sears'
),
(
'Chain'
,
'chain'
),
(
'Furrow Long'
,
'furlong'
)]
for
nm
,
att
in
unit_tuple
:
for
nm
,
att
in
unit_tuple
:
with
self
.
subTest
(
nm
=
nm
):
with
self
.
subTest
(
nm
=
nm
):
self
.
assertEqual
(
att
,
D
.
unit_attname
(
nm
))
self
.
assertEqual
(
att
,
D
.
unit_attname
(
nm
))
...
...
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