1
0
mirror of https://github.com/django/django.git synced 2025-10-29 08:36:09 +00:00

[py3] Ported django.utils.encoding.

* Renamed smart_unicode to smart_text (but kept the old name under
  Python 2 for backwards compatibility).
* Renamed smart_str to smart_bytes.
* Re-introduced smart_str as an alias for smart_text under Python 3
  and smart_bytes under Python 2 (which is backwards compatible).
  Thus smart_str always returns a str objects.
* Used the new smart_str in a few places where both Python 2 and 3
  want a str.
This commit is contained in:
Aymeric Augustin
2012-07-21 10:00:10 +02:00
parent ee191715ea
commit c5ef65bcf3
125 changed files with 629 additions and 583 deletions

View File

@@ -10,7 +10,7 @@ all about the internals of models in order to get the information it needs.
import copy
from django.utils.datastructures import SortedDict
from django.utils.encoding import force_unicode
from django.utils.encoding import force_text
from django.utils.tree import Node
from django.utils import six
from django.db import connections, DEFAULT_DB_ALIAS
@@ -1776,7 +1776,7 @@ class Query(object):
else:
param_iter = iter([])
for name, entry in select.items():
entry = force_unicode(entry)
entry = force_text(entry)
entry_params = []
pos = entry.find("%s")
while pos != -1: