New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhanced unicode support for models #3368
Enhanced unicode support for models #3368
Conversation
I added a warning about returning non-utf8-encoded strings from within ``def __unicode__()``, as I found it resulting in a 500 response and a plugin instance marked as <Empty>. After returning as UTF8 everything worked as expected. If you can't confirm these issues to be related or feel that the addition doesn't make sense for documentation readers, feel free to drop it.
Allow using django CMS with custom admin site
Reasons for failed test are strictly technical issues:
|
Tests restarted. |
Updated docs
…ble' into feature/python_2_unicode_compatible Conflicts: cms/models/placeholdermodel.py cms/models/pluginmodel.py
still failing? |
I would be cautious about introducing |
@piquadrat, do you have anything particular against |
The test failed at |
@piquadrat, I've carefully read discussions you pasted about unicode_literals. Thank you for signaling potential issues. I will try to avoid as much of them as possible. If you think django CMS should not rely on unicode_literals, we should decide on other solution because doing nothing is not an option. |
@mmarzantowicz I don't understand why |
Generally speaking Please also take into account that I'm only touching models in this PR where |
@mmarzantowicz still interested in this? |
I am biased from having worked on Django so much, but the |
I'd resume this |
Yes, I'm still interested in this topic. Please give me some time to update my repos and see what needs to be done here. Then I'll open some issues to discuss this matter deeply. Finally, do we go "the Django way" with unicode support for models? That means, the way I presented it in my first post with optional modifications? |
Consistency with upstream looks like a clear bonus to me. |
Just the beginning of long way to fully support PY3 and PY2 regarding strings, unicode etc.
from __future__ import unicode_literals
to inform python 2.x that we like it to behave like python 3.xpython_2_unicode_compatible
(it is present in django 1.4 and higher)force_text
which is equivalent toforce_unicode
in some casesu'...'
convention for marking strings as unicode (refer to point 1)