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
0ab1dc0a
Kaydet (Commit)
0ab1dc0a
authored
Tem 07, 2017
tarafından
Sergey Fedoseev
Kaydeden (comit)
Tim Graham
Eyl 08, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed deepcopy of AreaField and DistanceField.
üst
0c4ac12a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
conversion.py
django/contrib/gis/db/models/sql/conversion.py
+2
-0
test_fields.py
tests/gis_tests/test_fields.py
+15
-0
No files found.
django/contrib/gis/db/models/sql/conversion.py
Dosyayı görüntüle @
0ab1dc0a
...
...
@@ -11,6 +11,7 @@ from django.db import models
class
AreaField
(
models
.
FloatField
):
"Wrapper for Area values."
def
__init__
(
self
,
area_att
=
None
):
super
()
.
__init__
()
self
.
area_att
=
area_att
def
get_prep_value
(
self
,
value
):
...
...
@@ -40,6 +41,7 @@ class AreaField(models.FloatField):
class
DistanceField
(
models
.
FloatField
):
"Wrapper for Distance values."
def
__init__
(
self
,
distance_att
=
None
):
super
()
.
__init__
()
self
.
distance_att
=
distance_att
def
get_prep_value
(
self
,
value
):
...
...
tests/gis_tests/test_fields.py
0 → 100644
Dosyayı görüntüle @
0ab1dc0a
import
copy
from
django.contrib.gis.db.models.sql
import
AreaField
,
DistanceField
from
django.test
import
SimpleTestCase
class
FieldsTests
(
SimpleTestCase
):
def
test_area_field_deepcopy
(
self
):
field
=
AreaField
()
self
.
assertEqual
(
copy
.
deepcopy
(
field
),
field
)
def
test_distance_field_deepcopy
(
self
):
field
=
DistanceField
()
self
.
assertEqual
(
copy
.
deepcopy
(
field
),
field
)
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