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
ae7cb992
Kaydet (Commit)
ae7cb992
authored
Eki 28, 2014
tarafından
Collin Anderson
Kaydeden (comit)
Anssi Kääriäinen
Eki 28, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #23721 -- check_related_objects without calling __iter__
Refs #14334
üst
00aa5628
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
query.py
django/db/models/sql/query.py
+2
-3
models.py
tests/queries/models.py
+4
-0
No files found.
django/db/models/sql/query.py
Dosyayı görüntüle @
ae7cb992
...
...
@@ -1102,12 +1102,11 @@ class Query(object):
'Cannot use QuerySet for "
%
s": Use a QuerySet for "
%
s".'
%
(
value
.
model
.
_meta
.
model_name
,
opts
.
object_name
)
)
elif
hasattr
(
value
,
'_meta'
):
self
.
check_query_object_type
(
value
,
opts
)
elif
hasattr
(
value
,
'__iter__'
):
for
v
in
value
:
self
.
check_query_object_type
(
v
,
opts
)
else
:
# expecting single model instance here
self
.
check_query_object_type
(
value
,
opts
)
def
build_lookup
(
self
,
lookups
,
lhs
,
rhs
):
lookups
=
lookups
[:]
...
...
tests/queries/models.py
Dosyayı görüntüle @
ae7cb992
...
...
@@ -408,6 +408,10 @@ class ObjectA(models.Model):
def
__str__
(
self
):
return
self
.
name
def
__iter__
(
self
):
# Ticket #23721
assert
False
,
'type checking should happen without calling model __iter__'
class
ProxyObjectA
(
ObjectA
):
class
Meta
:
...
...
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