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
74106185
Kaydet (Commit)
74106185
authored
Haz 23, 2018
tarafından
Alexandr Tatarinov
Kaydeden (comit)
Tim Graham
Haz 25, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #29447 -- Made RelatedManager.set() pass bulk argument to clear().
üst
6b3e17ba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
1 deletion
+7
-1
AUTHORS
AUTHORS
+1
-0
related_descriptors.py
django/db/models/fields/related_descriptors.py
+1
-1
tests.py
tests/many_to_one_null/tests.py
+5
-0
No files found.
AUTHORS
Dosyayı görüntüle @
74106185
...
...
@@ -35,6 +35,7 @@ answer newbie questions, and generally made Django that much better:
Aleksi Häkli <aleksi.hakli@iki.fi>
Alexander Dutton <dev@alexdutton.co.uk>
Alexander Myodov <alex@myodov.com>
Alexandr Tatarinov <tatarinov1997@gmail.com>
Alex Couper <http://alexcouper.com/>
Alex Dedul
Alex Gaynor <alex.gaynor@gmail.com>
...
...
django/db/models/fields/related_descriptors.py
Dosyayı görüntüle @
74106185
...
...
@@ -708,7 +708,7 @@ def create_reverse_many_to_one_manager(superclass, rel):
db
=
router
.
db_for_write
(
self
.
model
,
instance
=
self
.
instance
)
with
transaction
.
atomic
(
using
=
db
,
savepoint
=
False
):
if
clear
:
self
.
clear
()
self
.
clear
(
bulk
=
bulk
)
self
.
add
(
*
objs
,
bulk
=
bulk
)
else
:
old_objs
=
set
(
self
.
using
(
db
)
.
all
())
...
...
tests/many_to_one_null/tests.py
Dosyayı görüntüle @
74106185
...
...
@@ -85,6 +85,11 @@ class ManyToOneNullTests(TestCase):
[
'<Article: Fourth>'
,
'<Article: Second>'
,
'<Article: Third>'
]
)
def
test_set_clear_non_bulk
(
self
):
# 2 queries for clear(), 1 for add(), and 1 to select objects.
with
self
.
assertNumQueries
(
4
):
self
.
r
.
article_set
.
set
([
self
.
a
],
bulk
=
False
,
clear
=
True
)
def
test_assign_clear_related_set
(
self
):
# Use descriptor assignment to allocate ForeignKey. Null is legal, so
# existing members of the set that are not in the assignment set are
...
...
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