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
87c76aa1
Kaydet (Commit)
87c76aa1
authored
Ara 04, 2017
tarafından
Дилян Палаузов
Kaydeden (comit)
Tim Graham
Ara 04, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #28873 -- Used dict.setdefault() to set model and form field defaults.
üst
d2afa5eb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
6 deletions
+5
-6
__init__.py
django/db/models/fields/__init__.py
+3
-3
files.py
django/db/models/fields/files.py
+1
-1
related.py
django/db/models/fields/related.py
+1
-2
No files found.
django/db/models/fields/__init__.py
Dosyayı görüntüle @
87c76aa1
...
@@ -1652,7 +1652,7 @@ class EmailField(CharField):
...
@@ -1652,7 +1652,7 @@ class EmailField(CharField):
def
__init__
(
self
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
# max_length=254 to be compliant with RFCs 3696 and 5321
# max_length=254 to be compliant with RFCs 3696 and 5321
kwargs
[
'max_length'
]
=
kwargs
.
ge
t
(
'max_length'
,
254
)
kwargs
.
setdefaul
t
(
'max_length'
,
254
)
super
()
.
__init__
(
*
args
,
**
kwargs
)
super
()
.
__init__
(
*
args
,
**
kwargs
)
def
deconstruct
(
self
):
def
deconstruct
(
self
):
...
@@ -1678,7 +1678,7 @@ class FilePathField(Field):
...
@@ -1678,7 +1678,7 @@ class FilePathField(Field):
recursive
=
False
,
allow_files
=
True
,
allow_folders
=
False
,
**
kwargs
):
recursive
=
False
,
allow_files
=
True
,
allow_folders
=
False
,
**
kwargs
):
self
.
path
,
self
.
match
,
self
.
recursive
=
path
,
match
,
recursive
self
.
path
,
self
.
match
,
self
.
recursive
=
path
,
match
,
recursive
self
.
allow_files
,
self
.
allow_folders
=
allow_files
,
allow_folders
self
.
allow_files
,
self
.
allow_folders
=
allow_files
,
allow_folders
kwargs
[
'max_length'
]
=
kwargs
.
ge
t
(
'max_length'
,
100
)
kwargs
.
setdefaul
t
(
'max_length'
,
100
)
super
()
.
__init__
(
verbose_name
,
name
,
**
kwargs
)
super
()
.
__init__
(
verbose_name
,
name
,
**
kwargs
)
def
check
(
self
,
**
kwargs
):
def
check
(
self
,
**
kwargs
):
...
@@ -2258,7 +2258,7 @@ class URLField(CharField):
...
@@ -2258,7 +2258,7 @@ class URLField(CharField):
description
=
_
(
"URL"
)
description
=
_
(
"URL"
)
def
__init__
(
self
,
verbose_name
=
None
,
name
=
None
,
**
kwargs
):
def
__init__
(
self
,
verbose_name
=
None
,
name
=
None
,
**
kwargs
):
kwargs
[
'max_length'
]
=
kwargs
.
ge
t
(
'max_length'
,
200
)
kwargs
.
setdefaul
t
(
'max_length'
,
200
)
super
()
.
__init__
(
verbose_name
,
name
,
**
kwargs
)
super
()
.
__init__
(
verbose_name
,
name
,
**
kwargs
)
def
deconstruct
(
self
):
def
deconstruct
(
self
):
...
...
django/db/models/fields/files.py
Dosyayı görüntüle @
87c76aa1
...
@@ -226,7 +226,7 @@ class FileField(Field):
...
@@ -226,7 +226,7 @@ class FileField(Field):
self
.
storage
=
storage
or
default_storage
self
.
storage
=
storage
or
default_storage
self
.
upload_to
=
upload_to
self
.
upload_to
=
upload_to
kwargs
[
'max_length'
]
=
kwargs
.
ge
t
(
'max_length'
,
100
)
kwargs
.
setdefaul
t
(
'max_length'
,
100
)
super
()
.
__init__
(
verbose_name
,
name
,
**
kwargs
)
super
()
.
__init__
(
verbose_name
,
name
,
**
kwargs
)
def
check
(
self
,
**
kwargs
):
def
check
(
self
,
**
kwargs
):
...
...
django/db/models/fields/related.py
Dosyayı görüntüle @
87c76aa1
...
@@ -808,8 +808,7 @@ class ForeignKey(ForeignObject):
...
@@ -808,8 +808,7 @@ class ForeignKey(ForeignObject):
parent_link
=
parent_link
,
parent_link
=
parent_link
,
on_delete
=
on_delete
,
on_delete
=
on_delete
,
)
)
kwargs
.
setdefault
(
'db_index'
,
True
)
kwargs
[
'db_index'
]
=
kwargs
.
get
(
'db_index'
,
True
)
super
()
.
__init__
(
to
,
on_delete
,
from_fields
=
[
'self'
],
to_fields
=
[
to_field
],
**
kwargs
)
super
()
.
__init__
(
to
,
on_delete
,
from_fields
=
[
'self'
],
to_fields
=
[
to_field
],
**
kwargs
)
...
...
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