From ebc773ada3e4f40cf5084268387b873d7fe22e8b Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Tue, 28 Aug 2012 20:59:56 +0200 Subject: Replaced many smart_bytes by force_bytes In all those occurrences, we didn't care about preserving the lazy status of the strings, but we really wanted to obtain a real bytestring. --- docs/ref/models/instances.txt | 4 ++-- docs/ref/settings.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/ref') diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt index b7ae3890cf..b01abc1936 100644 --- a/docs/ref/models/instances.txt +++ b/docs/ref/models/instances.txt @@ -459,9 +459,9 @@ using ``__str__()`` like this:: last_name = models.CharField(max_length=50) def __str__(self): - # Note use of django.utils.encoding.smart_bytes() here because + # Note use of django.utils.encoding.force_bytes() here because # first_name and last_name will be unicode strings. - return smart_bytes('%s %s' % (self.first_name, self.last_name)) + return force_bytes('%s %s' % (self.first_name, self.last_name)) ``get_absolute_url`` -------------------- diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index 32ba5f0ced..4729a2b6f1 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -183,7 +183,7 @@ compose a prefix, version and key into a final cache key. The default implementation is equivalent to the function:: def make_key(key, key_prefix, version): - return ':'.join([key_prefix, str(version), smart_bytes(key)]) + return ':'.join([key_prefix, str(version), key]) You may use any key function you want, as long as it has the same argument signature. -- cgit v1.3