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
a170c3f7
Kaydet (Commit)
a170c3f7
authored
Ock 12, 2013
tarafından
Alex Gaynor
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Removed some now dead code from deletion (thanks to Carl Meyer for noticing it).
üst
bcdb4898
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
14 deletions
+0
-14
deletion.py
django/db/models/deletion.py
+0
-14
No files found.
django/db/models/deletion.py
Dosyayı görüntüle @
a170c3f7
...
@@ -75,7 +75,6 @@ class Collector(object):
...
@@ -75,7 +75,6 @@ class Collector(object):
self
.
using
=
using
self
.
using
=
using
# Initially, {model: set([instances])}, later values become lists.
# Initially, {model: set([instances])}, later values become lists.
self
.
data
=
{}
self
.
data
=
{}
self
.
batches
=
{}
# {model: {field: set([instances])}}
self
.
field_updates
=
{}
# {model: {(field, value): set([instances])}}
self
.
field_updates
=
{}
# {model: {(field, value): set([instances])}}
# fast_deletes is a list of queryset-likes that can be deleted without
# fast_deletes is a list of queryset-likes that can be deleted without
# fetching the objects into memory.
# fetching the objects into memory.
...
@@ -115,13 +114,6 @@ class Collector(object):
...
@@ -115,13 +114,6 @@ class Collector(object):
source
.
_meta
.
concrete_model
,
set
())
.
add
(
model
.
_meta
.
concrete_model
)
source
.
_meta
.
concrete_model
,
set
())
.
add
(
model
.
_meta
.
concrete_model
)
return
new_objs
return
new_objs
def
add_batch
(
self
,
model
,
field
,
objs
):
"""
Schedules a batch delete. Every instance of 'model' that is related to
an instance of 'obj' through 'field' will be deleted.
"""
self
.
batches
.
setdefault
(
model
,
{})
.
setdefault
(
field
,
set
())
.
update
(
objs
)
def
add_field_update
(
self
,
field
,
value
,
objs
):
def
add_field_update
(
self
,
field
,
value
,
objs
):
"""
"""
Schedules a field update. 'objs' must be a homogenous iterable
Schedules a field update. 'objs' must be a homogenous iterable
...
@@ -303,12 +295,6 @@ class Collector(object):
...
@@ -303,12 +295,6 @@ class Collector(object):
for
instances
in
six
.
itervalues
(
self
.
data
):
for
instances
in
six
.
itervalues
(
self
.
data
):
instances
.
reverse
()
instances
.
reverse
()
# delete batches
for
model
,
batches
in
six
.
iteritems
(
self
.
batches
):
query
=
sql
.
DeleteQuery
(
model
)
for
field
,
instances
in
six
.
iteritems
(
batches
):
query
.
delete_batch
([
obj
.
pk
for
obj
in
instances
],
self
.
using
,
field
)
# delete instances
# delete instances
for
model
,
instances
in
six
.
iteritems
(
self
.
data
):
for
model
,
instances
in
six
.
iteritems
(
self
.
data
):
query
=
sql
.
DeleteQuery
(
model
)
query
=
sql
.
DeleteQuery
(
model
)
...
...
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