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
275811a9
Kaydet (Commit)
275811a9
authored
Nis 18, 2014
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Adapted fixture read mode to file type
Binary mode added in
ed532a6a
is not supported by ZipFile. Refs #22399.
üst
6b2ce38c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
loaddata.py
django/core/management/commands/loaddata.py
+7
-7
No files found.
django/core/management/commands/loaddata.py
Dosyayı görüntüle @
275811a9
...
...
@@ -76,13 +76,14 @@ class Command(BaseCommand):
self
.
models
=
set
()
self
.
serialization_formats
=
serializers
.
get_public_serializer_formats
()
# Forcing binary mode may be revisited after dropping Python 2 support (see #22399)
self
.
compression_formats
=
{
None
:
open
,
'gz'
:
gzip
.
GzipFile
,
'zip'
:
SingleZipReader
None
:
(
open
,
'rb'
)
,
'gz'
:
(
gzip
.
GzipFile
,
'rb'
)
,
'zip'
:
(
SingleZipReader
,
'r'
),
}
if
has_bz2
:
self
.
compression_formats
[
'bz2'
]
=
bz2
.
BZ2File
self
.
compression_formats
[
'bz2'
]
=
(
bz2
.
BZ2File
,
'r'
)
with
connection
.
constraint_checks_disabled
():
for
fixture_label
in
fixture_labels
:
...
...
@@ -124,9 +125,8 @@ class Command(BaseCommand):
"""
for
fixture_file
,
fixture_dir
,
fixture_name
in
self
.
find_fixtures
(
fixture_label
):
_
,
ser_fmt
,
cmp_fmt
=
self
.
parse_name
(
os
.
path
.
basename
(
fixture_file
))
open_method
=
self
.
compression_formats
[
cmp_fmt
]
# Forcing binary mode may be revisited after dropping Python 2 support (see #22399)
fixture
=
open_method
(
fixture_file
,
'rb'
)
open_method
,
mode
=
self
.
compression_formats
[
cmp_fmt
]
fixture
=
open_method
(
fixture_file
,
mode
)
try
:
self
.
fixture_count
+=
1
objects_in_fixture
=
0
...
...
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