summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2012-05-19 17:43:34 +0200
committerClaude Paroz <claude@2xlibre.net>2012-05-19 17:43:34 +0200
commit38408f8007eae21b9f1cbbcc7f86d4b2042ff86a (patch)
tree16cc42e7033bd03077f51ac6868569968e3bc14c /docs/ref
parent822d6d6dabc959532fb2904376580e8947c519f6 (diff)
Marked bytestrings with b prefix. Refs #18269
This is a preparation for unicode literals general usage in Django (Python 3 compatibility).
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/files/file.txt2
-rw-r--r--docs/ref/unicode.txt4
2 files changed, 3 insertions, 3 deletions
diff --git a/docs/ref/files/file.txt b/docs/ref/files/file.txt
index 013d113c84..10108d1f4f 100644
--- a/docs/ref/files/file.txt
+++ b/docs/ref/files/file.txt
@@ -96,7 +96,7 @@ The ``ContentFile`` Class
from django.core.files.base import ContentFile
- f1 = ContentFile("my string content")
+ f1 = ContentFile(b"my string content")
f2 = ContentFile(u"my unicode content encoded as UTF-8".encode('UTF-8'))
.. currentmodule:: django.core.files.images
diff --git a/docs/ref/unicode.txt b/docs/ref/unicode.txt
index 1286dcfdd0..46ce4138a4 100644
--- a/docs/ref/unicode.txt
+++ b/docs/ref/unicode.txt
@@ -269,7 +269,7 @@ You can pass either Unicode strings or UTF-8 bytestrings as arguments to
querysets are identical::
qs = People.objects.filter(name__contains=u'Å')
- qs = People.objects.filter(name__contains='\xc3\x85') # UTF-8 encoding of Å
+ qs = People.objects.filter(name__contains=b'\xc3\x85') # UTF-8 encoding of Å
Templates
=========
@@ -277,7 +277,7 @@ Templates
You can use either Unicode or bytestrings when creating templates manually::
from django.template import Template
- t1 = Template('This is a bytestring template.')
+ t1 = Template(b'This is a bytestring template.')
t2 = Template(u'This is a Unicode template.')
But the common case is to read templates from the filesystem, and this creates