From f8ea12f36b7f2e077887a1a02478ea24884b4514 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Wed, 15 Aug 2012 12:09:59 +0200 Subject: [PATCH] [py3] Removed excessive usage of smart_bytes --- django/core/handlers/wsgi.py | 4 ++-- django/db/models/base.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/django/core/handlers/wsgi.py b/django/core/handlers/wsgi.py index 70b23f8515..a0186e552f 100644 --- a/django/core/handlers/wsgi.py +++ b/django/core/handlers/wsgi.py @@ -9,7 +9,7 @@ from django.core import signals from django.core.handlers import base from django.core.urlresolvers import set_script_prefix from django.utils import datastructures -from django.utils.encoding import force_text, smart_bytes, iri_to_uri +from django.utils.encoding import force_text, smart_str, iri_to_uri from django.utils.log import getLogger logger = getLogger('django.request') @@ -246,5 +246,5 @@ class WSGIHandler(base.BaseHandler): response_headers = [(str(k), str(v)) for k, v in response.items()] for c in response.cookies.values(): response_headers.append((str('Set-Cookie'), str(c.output(header='')))) - start_response(smart_bytes(status), response_headers) + start_response(smart_str(status), response_headers) return response diff --git a/django/db/models/base.py b/django/db/models/base.py index 1beb6f9e30..fd7250cdb0 100644 --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -23,7 +23,7 @@ from django.db.models import signals from django.db.models.loading import register_models, get_model from django.utils.translation import ugettext_lazy as _ from django.utils.functional import curry -from django.utils.encoding import smart_bytes, smart_str, force_text +from django.utils.encoding import smart_str, force_text from django.utils import six from django.utils.text import get_text_list, capfirst @@ -654,7 +654,7 @@ class Model(six.with_metaclass(ModelBase, object)): raise ValueError("get_next/get_previous cannot be used on unsaved objects.") op = is_next and 'gt' or 'lt' order = not is_next and '-' or '' - param = smart_bytes(getattr(self, field.attname)) + param = force_text(getattr(self, field.attname)) q = Q(**{'%s__%s' % (field.name, op): param}) q = q|Q(**{field.name: param, 'pk__%s' % op: self.pk}) qs = self.__class__._default_manager.using(self._state.db).filter(**kwargs).filter(q).order_by('%s%s' % (order, field.name), '%spk' % order)