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
dce34dc9
Kaydet (Commit)
dce34dc9
authored
Agu 12, 2012
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[py3] Made __repr__ return str with Python 3
üst
c1684e3d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
15 deletions
+17
-15
datastructures.py
django/contrib/databrowse/datastructures.py
+6
-6
uploadedfile.py
django/core/files/uploadedfile.py
+2
-2
urlresolvers.py
django/core/urlresolvers.py
+5
-3
base.py
django/db/models/base.py
+2
-2
base.py
django/template/base.py
+2
-2
No files found.
django/contrib/databrowse/datastructures.py
Dosyayı görüntüle @
dce34dc9
...
...
@@ -7,7 +7,7 @@ from __future__ import unicode_literals
from
django.db
import
models
from
django.utils
import
formats
from
django.utils.text
import
capfirst
from
django.utils.encoding
import
smart_text
,
smart_
bytes
,
iri_to_uri
from
django.utils.encoding
import
smart_text
,
smart_
str
,
iri_to_uri
from
django.db.models.query
import
QuerySet
from
django.utils.encoding
import
python_2_unicode_compatible
...
...
@@ -23,7 +23,7 @@ class EasyModel(object):
self
.
verbose_name_plural
=
model
.
_meta
.
verbose_name_plural
def
__repr__
(
self
):
return
'<EasyModel for
%
s>'
%
smart_bytes
(
self
.
model
.
_meta
.
object_name
)
return
smart_str
(
'<EasyModel for
%
s>'
%
self
.
model
.
_meta
.
object_name
)
def
model_databrowse
(
self
):
"Returns the ModelDatabrowse class for this model."
...
...
@@ -62,7 +62,7 @@ class EasyField(object):
self
.
model
,
self
.
field
=
easy_model
,
field
def
__repr__
(
self
):
return
smart_
bytes
(
'<EasyField for
%
s.
%
s>'
%
(
self
.
model
.
model
.
_meta
.
object_name
,
self
.
field
.
name
))
return
smart_
str
(
'<EasyField for
%
s.
%
s>'
%
(
self
.
model
.
model
.
_meta
.
object_name
,
self
.
field
.
name
))
def
choices
(
self
):
for
value
,
label
in
self
.
field
.
choices
:
...
...
@@ -80,7 +80,7 @@ class EasyChoice(object):
self
.
value
,
self
.
label
=
value
,
label
def
__repr__
(
self
):
return
smart_
bytes
(
'<EasyChoice for
%
s.
%
s>'
%
(
self
.
model
.
model
.
_meta
.
object_name
,
self
.
field
.
name
))
return
smart_
str
(
'<EasyChoice for
%
s.
%
s>'
%
(
self
.
model
.
model
.
_meta
.
object_name
,
self
.
field
.
name
))
def
url
(
self
):
return
'
%
s
%
s/
%
s/
%
s/
%
s/'
%
(
self
.
model
.
site
.
root_url
,
self
.
model
.
model
.
_meta
.
app_label
,
self
.
model
.
model
.
_meta
.
module_name
,
self
.
field
.
field
.
name
,
iri_to_uri
(
self
.
value
))
...
...
@@ -91,7 +91,7 @@ class EasyInstance(object):
self
.
model
,
self
.
instance
=
easy_model
,
instance
def
__repr__
(
self
):
return
smart_
bytes
(
'<EasyInstance for
%
s (
%
s)>'
%
(
self
.
model
.
model
.
_meta
.
object_name
,
self
.
instance
.
_get_pk_val
()))
return
smart_
str
(
'<EasyInstance for
%
s (
%
s)>'
%
(
self
.
model
.
model
.
_meta
.
object_name
,
self
.
instance
.
_get_pk_val
()))
def
__str__
(
self
):
val
=
smart_text
(
self
.
instance
)
...
...
@@ -135,7 +135,7 @@ class EasyInstanceField(object):
self
.
raw_value
=
getattr
(
instance
.
instance
,
field
.
name
)
def
__repr__
(
self
):
return
smart_
bytes
(
'<EasyInstanceField for
%
s.
%
s>'
%
(
self
.
model
.
model
.
_meta
.
object_name
,
self
.
field
.
name
))
return
smart_
str
(
'<EasyInstanceField for
%
s.
%
s>'
%
(
self
.
model
.
model
.
_meta
.
object_name
,
self
.
field
.
name
))
def
values
(
self
):
"""
...
...
django/core/files/uploadedfile.py
Dosyayı görüntüle @
dce34dc9
...
...
@@ -8,7 +8,7 @@ from io import BytesIO
from
django.conf
import
settings
from
django.core.files.base
import
File
from
django.core.files
import
temp
as
tempfile
from
django.utils.encoding
import
smart_
bytes
from
django.utils.encoding
import
smart_
str
__all__
=
(
'UploadedFile'
,
'TemporaryUploadedFile'
,
'InMemoryUploadedFile'
,
'SimpleUploadedFile'
)
...
...
@@ -30,7 +30,7 @@ class UploadedFile(File):
self
.
charset
=
charset
def
__repr__
(
self
):
return
smart_
bytes
(
"<
%
s:
%
s (
%
s)>"
%
(
return
smart_
str
(
"<
%
s:
%
s (
%
s)>"
%
(
self
.
__class__
.
__name__
,
self
.
name
,
self
.
content_type
))
def
_get_name
(
self
):
...
...
django/core/urlresolvers.py
Dosyayı görüntüle @
dce34dc9
...
...
@@ -14,7 +14,7 @@ from threading import local
from
django.http
import
Http404
from
django.core.exceptions
import
ImproperlyConfigured
,
ViewDoesNotExist
from
django.utils.datastructures
import
MultiValueDict
from
django.utils.encoding
import
iri_to_uri
,
force_text
,
smart_
bytes
from
django.utils.encoding
import
iri_to_uri
,
force_text
,
smart_
str
from
django.utils.functional
import
memoize
,
lazy
from
django.utils.importlib
import
import_module
from
django.utils.module_loading
import
module_has_submodule
...
...
@@ -190,7 +190,7 @@ class RegexURLPattern(LocaleRegexProvider):
self
.
name
=
name
def
__repr__
(
self
):
return
smart_
bytes
(
'<
%
s
%
s
%
s>'
%
(
self
.
__class__
.
__name__
,
self
.
name
,
self
.
regex
.
pattern
))
return
smart_
str
(
'<
%
s
%
s
%
s>'
%
(
self
.
__class__
.
__name__
,
self
.
name
,
self
.
regex
.
pattern
))
def
add_prefix
(
self
,
prefix
):
"""
...
...
@@ -240,7 +240,9 @@ class RegexURLResolver(LocaleRegexProvider):
self
.
_app_dict
=
{}
def
__repr__
(
self
):
return
smart_bytes
(
'<
%
s
%
s (
%
s:
%
s)
%
s>'
%
(
self
.
__class__
.
__name__
,
self
.
urlconf_name
,
self
.
app_name
,
self
.
namespace
,
self
.
regex
.
pattern
))
return
smart_str
(
'<
%
s
%
s (
%
s:
%
s)
%
s>'
%
(
self
.
__class__
.
__name__
,
self
.
urlconf_name
,
self
.
app_name
,
self
.
namespace
,
self
.
regex
.
pattern
))
def
_populate
(
self
):
lookups
=
MultiValueDict
()
...
...
django/db/models/base.py
Dosyayı görüntüle @
dce34dc9
...
...
@@ -23,7 +23,7 @@ from django.db.models import signals
from
django.db.models.loading
import
register_models
,
get_model
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.functional
import
curry
from
django.utils.encoding
import
smart_bytes
,
force_text
from
django.utils.encoding
import
smart_bytes
,
smart_str
,
force_text
from
django.utils
import
six
from
django.utils.text
import
get_text_list
,
capfirst
...
...
@@ -404,7 +404,7 @@ class Model(six.with_metaclass(ModelBase, object)):
u
=
six
.
text_type
(
self
)
except
(
UnicodeEncodeError
,
UnicodeDecodeError
):
u
=
'[Bad Unicode data]'
return
smart_
bytes
(
'<
%
s:
%
s>'
%
(
self
.
__class__
.
__name__
,
u
))
return
smart_
str
(
'<
%
s:
%
s>'
%
(
self
.
__class__
.
__name__
,
u
))
def
__str__
(
self
):
if
not
six
.
PY3
and
hasattr
(
self
,
'__unicode__'
):
...
...
django/template/base.py
Dosyayı görüntüle @
dce34dc9
...
...
@@ -11,7 +11,7 @@ from django.utils.importlib import import_module
from
django.utils.itercompat
import
is_iterable
from
django.utils.text
import
(
smart_split
,
unescape_string_literal
,
get_text_list
)
from
django.utils.encoding
import
smart_text
,
force_text
,
smart_
bytes
from
django.utils.encoding
import
smart_text
,
force_text
,
smart_
str
from
django.utils.translation
import
ugettext_lazy
,
pgettext_lazy
from
django.utils.safestring
import
(
SafeData
,
EscapeData
,
mark_safe
,
mark_for_escaping
)
...
...
@@ -848,7 +848,7 @@ class TextNode(Node):
self
.
s
=
s
def
__repr__
(
self
):
return
"<Text Node: '
%
s'>"
%
smart_
bytes
(
self
.
s
[:
25
],
'ascii'
,
return
"<Text Node: '
%
s'>"
%
smart_
str
(
self
.
s
[:
25
],
'ascii'
,
errors
=
'replace'
)
def
render
(
self
,
context
):
...
...
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