mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Marked bytestrings with b prefix. Refs #18269
This is a preparation for unicode literals general usage in Django (Python 3 compatibility).
This commit is contained in:
parent
822d6d6dab
commit
38408f8007
44 changed files with 296 additions and 295 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue