summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-08-11 22:20:59 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-08-12 14:44:40 +0200
commite7e08fd48b3f88d4eb481f5b213b923fc1db3675 (patch)
treed6e13e9cb6e8980de88d58374b47370ef0b55b00 /django
parent2bb2eecb6358ea4243ab7a6286048b86302f5128 (diff)
[py3] Replaced some __str__ methods by __unicode__
These methods actually return unicode.
Diffstat (limited to 'django')
-rw-r--r--django/core/files/base.py2
-rw-r--r--django/db/models/options.py8
2 files changed, 6 insertions, 4 deletions
diff --git a/django/core/files/base.py b/django/core/files/base.py
index 87fa8bc8ec..4ad0be4fd8 100644
--- a/django/core/files/base.py
+++ b/django/core/files/base.py
@@ -130,7 +130,7 @@ class ContentFile(File):
super(ContentFile, self).__init__(BytesIO(content), name=name)
self.size = len(content)
- def __str__(self):
+ def __unicode__(self):
return 'Raw content'
def __bool__(self):
diff --git a/django/db/models/options.py b/django/db/models/options.py
index 2e8ccb49ce..9211a76b68 100644
--- a/django/db/models/options.py
+++ b/django/db/models/options.py
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
import re
from bisect import bisect
@@ -8,7 +10,7 @@ from django.db.models.fields import AutoField, FieldDoesNotExist
from django.db.models.fields.proxy import OrderWrt
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.encoding import force_text, smart_bytes
+from django.utils.encoding import force_text, smart_text
from django.utils.datastructures import SortedDict
from django.utils import six
@@ -198,8 +200,8 @@ class Options(object):
def __repr__(self):
return '<Options for %s>' % self.object_name
- def __str__(self):
- return "%s.%s" % (smart_bytes(self.app_label), smart_bytes(self.module_name))
+ def __unicode__(self):
+ return "%s.%s" % (smart_text(self.app_label), smart_text(self.module_name))
def verbose_name_raw(self):
"""