Handle unicode/str cast operators.
Review Request #4920 — Created Nov. 8, 2013 and submitted — Latest diff uploaded
Handle unicode/str cast operators.
A few of our objects defined
__str__
and/or__unicode__
methods. This presents
some complications for porting to python 3, since str has different meanings.Django provides a decorator,
@python_2_unicode_compatible
, whereby you define
__str__
using python 3 semantics (i.e. it returns unicode), and when running
with python 2, it will rename that to__unicode__
and make__str__
call that
and encode to utf-8.
- Ran unit tests
- Checked list displays in the admin
Diff Revision 2 (Latest)
orig
1
2
reviewboard/accounts/admin.py |
---|
reviewboard/accounts/models.py |
---|
reviewboard/attachments/models.py |
---|
reviewboard/changedescs/models.py |
---|
reviewboard/diffviewer/admin.py |
---|
reviewboard/diffviewer/models.py |
---|
reviewboard/hostingsvcs/models.py |
---|
reviewboard/reviews/models.py |
---|
reviewboard/reviews/tests.py |
---|
reviewboard/scmtools/admin.py |
---|
reviewboard/scmtools/core.py |
---|
reviewboard/scmtools/models.py |
---|
reviewboard/site/models.py |
---|