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
e7e08fd4
Kaydet (Commit)
e7e08fd4
authored
Agu 11, 2012
tarafından
Aymeric Augustin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[py3] Replaced some __str__ methods by __unicode__
These methods actually return unicode.
üst
2bb2eecb
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
10 deletions
+18
-10
base.py
django/core/files/base.py
+1
-1
options.py
django/db/models/options.py
+5
-3
models.py
tests/modeltests/delete/models.py
+3
-1
models.py
tests/regressiontests/comment_tests/models.py
+5
-3
models.py
tests/regressiontests/datatypes/models.py
+1
-1
models.py
tests/regressiontests/string_lookup/models.py
+3
-1
No files found.
django/core/files/base.py
Dosyayı görüntüle @
e7e08fd4
...
@@ -130,7 +130,7 @@ class ContentFile(File):
...
@@ -130,7 +130,7 @@ class ContentFile(File):
super
(
ContentFile
,
self
)
.
__init__
(
BytesIO
(
content
),
name
=
name
)
super
(
ContentFile
,
self
)
.
__init__
(
BytesIO
(
content
),
name
=
name
)
self
.
size
=
len
(
content
)
self
.
size
=
len
(
content
)
def
__
str
__
(
self
):
def
__
unicode
__
(
self
):
return
'Raw content'
return
'Raw content'
def
__bool__
(
self
):
def
__bool__
(
self
):
...
...
django/db/models/options.py
Dosyayı görüntüle @
e7e08fd4
from
__future__
import
unicode_literals
import
re
import
re
from
bisect
import
bisect
from
bisect
import
bisect
...
@@ -8,7 +10,7 @@ from django.db.models.fields import AutoField, FieldDoesNotExist
...
@@ -8,7 +10,7 @@ from django.db.models.fields import AutoField, FieldDoesNotExist
from
django.db.models.fields.proxy
import
OrderWrt
from
django.db.models.fields.proxy
import
OrderWrt
from
django.db.models.loading
import
get_models
,
app_cache_ready
from
django.db.models.loading
import
get_models
,
app_cache_ready
from
django.utils.translation
import
activate
,
deactivate_all
,
get_language
,
string_concat
from
django.utils.translation
import
activate
,
deactivate_all
,
get_language
,
string_concat
from
django.utils.encoding
import
force_text
,
smart_
bytes
from
django.utils.encoding
import
force_text
,
smart_
text
from
django.utils.datastructures
import
SortedDict
from
django.utils.datastructures
import
SortedDict
from
django.utils
import
six
from
django.utils
import
six
...
@@ -198,8 +200,8 @@ class Options(object):
...
@@ -198,8 +200,8 @@ class Options(object):
def
__repr__
(
self
):
def
__repr__
(
self
):
return
'<Options for
%
s>'
%
self
.
object_name
return
'<Options for
%
s>'
%
self
.
object_name
def
__
str
__
(
self
):
def
__
unicode
__
(
self
):
return
"
%
s.
%
s"
%
(
smart_
bytes
(
self
.
app_label
),
smart_bytes
(
self
.
module_name
))
return
"
%
s.
%
s"
%
(
smart_
text
(
self
.
app_label
),
smart_text
(
self
.
module_name
))
def
verbose_name_raw
(
self
):
def
verbose_name_raw
(
self
):
"""
"""
...
...
tests/modeltests/delete/models.py
Dosyayı görüntüle @
e7e08fd4
from
__future__
import
unicode_literals
from
django.db
import
models
from
django.db
import
models
class
R
(
models
.
Model
):
class
R
(
models
.
Model
):
is_default
=
models
.
BooleanField
(
default
=
False
)
is_default
=
models
.
BooleanField
(
default
=
False
)
def
__
str
__
(
self
):
def
__
unicode
__
(
self
):
return
"
%
s"
%
self
.
pk
return
"
%
s"
%
self
.
pk
...
...
tests/regressiontests/comment_tests/models.py
Dosyayı görüntüle @
e7e08fd4
...
@@ -3,6 +3,8 @@ Comments may be attached to any object. See the comment documentation for
...
@@ -3,6 +3,8 @@ Comments may be attached to any object. See the comment documentation for
more information.
more information.
"""
"""
from
__future__
import
unicode_literals
from
django.db
import
models
from
django.db
import
models
...
@@ -10,14 +12,14 @@ class Author(models.Model):
...
@@ -10,14 +12,14 @@ class Author(models.Model):
first_name
=
models
.
CharField
(
max_length
=
30
)
first_name
=
models
.
CharField
(
max_length
=
30
)
last_name
=
models
.
CharField
(
max_length
=
30
)
last_name
=
models
.
CharField
(
max_length
=
30
)
def
__
str
__
(
self
):
def
__
unicode
__
(
self
):
return
'
%
s
%
s'
%
(
self
.
first_name
,
self
.
last_name
)
return
'
%
s
%
s'
%
(
self
.
first_name
,
self
.
last_name
)
class
Article
(
models
.
Model
):
class
Article
(
models
.
Model
):
author
=
models
.
ForeignKey
(
Author
)
author
=
models
.
ForeignKey
(
Author
)
headline
=
models
.
CharField
(
max_length
=
100
)
headline
=
models
.
CharField
(
max_length
=
100
)
def
__
str
__
(
self
):
def
__
unicode
__
(
self
):
return
self
.
headline
return
self
.
headline
class
Entry
(
models
.
Model
):
class
Entry
(
models
.
Model
):
...
@@ -26,7 +28,7 @@ class Entry(models.Model):
...
@@ -26,7 +28,7 @@ class Entry(models.Model):
pub_date
=
models
.
DateField
()
pub_date
=
models
.
DateField
()
enable_comments
=
models
.
BooleanField
()
enable_comments
=
models
.
BooleanField
()
def
__
str
__
(
self
):
def
__
unicode
__
(
self
):
return
self
.
title
return
self
.
title
class
Book
(
models
.
Model
):
class
Book
(
models
.
Model
):
...
...
tests/regressiontests/datatypes/models.py
Dosyayı görüntüle @
e7e08fd4
...
@@ -18,7 +18,7 @@ class Donut(models.Model):
...
@@ -18,7 +18,7 @@ class Donut(models.Model):
class
Meta
:
class
Meta
:
ordering
=
(
'consumed_at'
,)
ordering
=
(
'consumed_at'
,)
def
__
str
__
(
self
):
def
__
unicode
__
(
self
):
return
self
.
name
return
self
.
name
class
RumBaba
(
models
.
Model
):
class
RumBaba
(
models
.
Model
):
...
...
tests/regressiontests/string_lookup/models.py
Dosyayı görüntüle @
e7e08fd4
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
models
from
django.db
import
models
...
@@ -42,5 +44,5 @@ class Article(models.Model):
...
@@ -42,5 +44,5 @@ class Article(models.Model):
text
=
models
.
TextField
()
text
=
models
.
TextField
()
submitted_from
=
models
.
IPAddressField
(
blank
=
True
,
null
=
True
)
submitted_from
=
models
.
IPAddressField
(
blank
=
True
,
null
=
True
)
def
__
str
__
(
self
):
def
__
unicode
__
(
self
):
return
"Article
%
s"
%
self
.
name
return
"Article
%
s"
%
self
.
name
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