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
d6c8121e
Kaydet (Commit)
d6c8121e
authored
Ock 08, 2015
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Removed unneeded smart_text calls
`verbose_name_raw` return value comes from `force_text()` anyway.
üst
de4bfb3f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
models.py
django/contrib/contenttypes/models.py
+3
-5
No files found.
django/contrib/contenttypes/models.py
Dosyayı görüntüle @
d6c8121e
...
...
@@ -4,7 +4,7 @@ from django.apps import apps
from
django.db
import
models
from
django.db.utils
import
OperationalError
,
ProgrammingError
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.encoding
import
smart_text
,
force_text
from
django.utils.encoding
import
force_text
from
django.utils.encoding
import
python_2_unicode_compatible
...
...
@@ -63,12 +63,10 @@ class ContentTypeManager(models.Manager):
except
self
.
model
.
DoesNotExist
:
# Not found in the database; we proceed to create it. This time we
# use get_or_create to take care of any race conditions.
# The smart_text() is needed around opts.verbose_name_raw because
# name_raw might be a django.utils.functional.__proxy__ object.
ct
,
created
=
self
.
get_or_create
(
app_label
=
opts
.
app_label
,
model
=
opts
.
model_name
,
defaults
=
{
'name'
:
smart_text
(
opts
.
verbose_name_raw
)
},
defaults
=
{
'name'
:
opts
.
verbose_name_raw
},
)
self
.
_add_to_cache
(
self
.
db
,
ct
)
return
ct
...
...
@@ -110,7 +108,7 @@ class ContentTypeManager(models.Manager):
ct
=
self
.
create
(
app_label
=
opts
.
app_label
,
model
=
opts
.
model_name
,
name
=
smart_text
(
opts
.
verbose_name_raw
)
,
name
=
opts
.
verbose_name_raw
,
)
self
.
_add_to_cache
(
self
.
db
,
ct
)
results
[
ct
.
model_class
()]
=
ct
...
...
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