Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[py3] Avoided returning bytes in Model.__str__

on Python 3.
  • Loading branch information...
commit dbb63e56eaa6e2e2a574d4327464332b3ef9f970 1 parent 9e7b5ba
@aaugustin aaugustin authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  django/db/models/
2  django/db/models/
@@ -407,7 +407,7 @@ def __repr__(self):
return smart_bytes('<%s: %s>' % (self.__class__.__name__, u))
def __str__(self):
- if hasattr(self, '__unicode__'):
+ if not six.PY3 and hasattr(self, '__unicode__'):
return force_text(self).encode('utf-8')
return '%s object' % self.__class__.__name__
Please sign in to comment.
Something went wrong with that request. Please try again.