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
4508fafe
Kaydet (Commit)
4508fafe
authored
Eyl 28, 2017
tarafından
Mads Jensen
Kaydeden (comit)
Tim Graham
Eyl 28, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Simplified various __eq__() methods.
üst
129f4900
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
22 additions
and
29 deletions
+22
-29
adapter.py
django/contrib/gis/db/backends/base/adapter.py
+4
-3
adapter.py
django/contrib/gis/db/backends/postgis/adapter.py
+1
-3
geometries.py
django/contrib/gis/gdal/geometries.py
+1
-4
migration.py
django/db/migrations/migration.py
+5
-3
query.py
django/db/models/query.py
+1
-3
base.py
django/template/base.py
+1
-3
context.py
django/template/context.py
+4
-5
tree.py
django/utils/tree.py
+5
-5
No files found.
django/contrib/gis/db/backends/base/adapter.py
Dosyayı görüntüle @
4508fafe
...
@@ -7,9 +7,10 @@ class WKTAdapter:
...
@@ -7,9 +7,10 @@ class WKTAdapter:
self
.
srid
=
geom
.
srid
self
.
srid
=
geom
.
srid
def
__eq__
(
self
,
other
):
def
__eq__
(
self
,
other
):
if
not
isinstance
(
other
,
WKTAdapter
):
return
(
return
False
isinstance
(
other
,
WKTAdapter
)
and
return
self
.
wkt
==
other
.
wkt
and
self
.
srid
==
other
.
srid
self
.
wkt
==
other
.
wkt
and
self
.
srid
==
other
.
srid
)
def
__hash__
(
self
):
def
__hash__
(
self
):
return
hash
((
self
.
wkt
,
self
.
srid
))
return
hash
((
self
.
wkt
,
self
.
srid
))
...
...
django/contrib/gis/db/backends/postgis/adapter.py
Dosyayı görüntüle @
4508fafe
...
@@ -34,9 +34,7 @@ class PostGISAdapter:
...
@@ -34,9 +34,7 @@ class PostGISAdapter:
raise
Exception
(
'Error implementing psycopg2 protocol. Is psycopg2 installed?'
)
raise
Exception
(
'Error implementing psycopg2 protocol. Is psycopg2 installed?'
)
def
__eq__
(
self
,
other
):
def
__eq__
(
self
,
other
):
if
not
isinstance
(
other
,
PostGISAdapter
):
return
isinstance
(
other
,
PostGISAdapter
)
and
self
.
ewkb
==
other
.
ewkb
return
False
return
self
.
ewkb
==
other
.
ewkb
def
__hash__
(
self
):
def
__hash__
(
self
):
return
hash
(
self
.
ewkb
)
return
hash
(
self
.
ewkb
)
...
...
django/contrib/gis/gdal/geometries.py
Dosyayı görüntüle @
4508fafe
...
@@ -190,10 +190,7 @@ class OGRGeometry(GDALBase):
...
@@ -190,10 +190,7 @@ class OGRGeometry(GDALBase):
def
__eq__
(
self
,
other
):
def
__eq__
(
self
,
other
):
"Is this Geometry equal to the other?"
"Is this Geometry equal to the other?"
if
isinstance
(
other
,
OGRGeometry
):
return
isinstance
(
other
,
OGRGeometry
)
and
self
.
equals
(
other
)
return
self
.
equals
(
other
)
else
:
return
False
def
__str__
(
self
):
def
__str__
(
self
):
"WKT is used for the string representation."
"WKT is used for the string representation."
...
...
django/db/migrations/migration.py
Dosyayı görüntüle @
4508fafe
...
@@ -58,9 +58,11 @@ class Migration:
...
@@ -58,9 +58,11 @@ class Migration:
self
.
replaces
=
list
(
self
.
__class__
.
replaces
)
self
.
replaces
=
list
(
self
.
__class__
.
replaces
)
def
__eq__
(
self
,
other
):
def
__eq__
(
self
,
other
):
if
not
isinstance
(
other
,
Migration
):
return
(
return
False
isinstance
(
other
,
Migration
)
and
return
(
self
.
name
==
other
.
name
)
and
(
self
.
app_label
==
other
.
app_label
)
self
.
name
==
other
.
name
and
self
.
app_label
==
other
.
app_label
)
def
__repr__
(
self
):
def
__repr__
(
self
):
return
"<Migration
%
s.
%
s>"
%
(
self
.
app_label
,
self
.
name
)
return
"<Migration
%
s.
%
s>"
%
(
self
.
app_label
,
self
.
name
)
...
...
django/db/models/query.py
Dosyayı görüntüle @
4508fafe
...
@@ -1413,9 +1413,7 @@ class Prefetch:
...
@@ -1413,9 +1413,7 @@ class Prefetch:
return
None
return
None
def
__eq__
(
self
,
other
):
def
__eq__
(
self
,
other
):
if
isinstance
(
other
,
Prefetch
):
return
isinstance
(
other
,
Prefetch
)
and
self
.
prefetch_to
==
other
.
prefetch_to
return
self
.
prefetch_to
==
other
.
prefetch_to
return
False
def
__hash__
(
self
):
def
__hash__
(
self
):
return
hash
(
self
.
__class__
)
^
hash
(
self
.
prefetch_to
)
return
hash
(
self
.
__class__
)
^
hash
(
self
.
prefetch_to
)
...
...
django/template/base.py
Dosyayı görüntüle @
4508fafe
...
@@ -126,10 +126,8 @@ class Origin:
...
@@ -126,10 +126,8 @@ class Origin:
return
self
.
name
return
self
.
name
def
__eq__
(
self
,
other
):
def
__eq__
(
self
,
other
):
if
not
isinstance
(
other
,
Origin
):
return
False
return
(
return
(
isinstance
(
other
,
Origin
)
and
self
.
name
==
other
.
name
and
self
.
name
==
other
.
name
and
self
.
loader
==
other
.
loader
self
.
loader
==
other
.
loader
)
)
...
...
django/template/context.py
Dosyayı görüntüle @
4508fafe
...
@@ -127,13 +127,12 @@ class BaseContext:
...
@@ -127,13 +127,12 @@ class BaseContext:
"""
"""
Compare two contexts by comparing theirs 'dicts' attributes.
Compare two contexts by comparing theirs 'dicts' attributes.
"""
"""
if
isinstance
(
other
,
BaseContext
):
return
(
isinstance
(
other
,
BaseContext
)
and
# because dictionaries can be put in different order
# because dictionaries can be put in different order
# we have to flatten them like in templates
# we have to flatten them like in templates
return
self
.
flatten
()
==
other
.
flatten
()
self
.
flatten
()
==
other
.
flatten
()
)
# if it's not comparable return false
return
False
class
Context
(
BaseContext
):
class
Context
(
BaseContext
):
...
...
django/utils/tree.py
Dosyayı görüntüle @
4508fafe
...
@@ -64,11 +64,11 @@ class Node:
...
@@ -64,11 +64,11 @@ class Node:
return
other
in
self
.
children
return
other
in
self
.
children
def
__eq__
(
self
,
other
):
def
__eq__
(
self
,
other
):
if
self
.
__class__
!=
other
.
__class__
:
return
(
return
False
self
.
__class__
==
other
.
__class__
and
if
(
self
.
connector
,
self
.
negated
)
==
(
other
.
connector
,
other
.
negated
):
(
self
.
connector
,
self
.
negated
)
==
(
other
.
connector
,
other
.
negated
)
and
return
self
.
children
==
other
.
children
self
.
children
==
other
.
children
return
False
)
def
add
(
self
,
data
,
conn_type
,
squash
=
True
):
def
add
(
self
,
data
,
conn_type
,
squash
=
True
):
"""
"""
...
...
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