mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
unicode: Typo fixing.
git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5334 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
b579a3cc64
commit
5a396c8b1d
@ -54,7 +54,7 @@ encoded using UTF-8.
|
|||||||
If your code only uses ASCII data, you are quite safe to simply use your normal
|
If your code only uses ASCII data, you are quite safe to simply use your normal
|
||||||
strings (since ASCII is a subset of UTF-8) and pass them around at will.
|
strings (since ASCII is a subset of UTF-8) and pass them around at will.
|
||||||
|
|
||||||
Do not be fooled into thinking that if you ``DEFAULT_CHARSET`` setting is set
|
Do not be fooled into thinking that if your ``DEFAULT_CHARSET`` setting is set
|
||||||
to something other than ``utf-8`` you can use that encoding in your
|
to something other than ``utf-8`` you can use that encoding in your
|
||||||
bytestrings! The ``DEFAULT_CHARSET`` only applies to the strings generated as
|
bytestrings! The ``DEFAULT_CHARSET`` only applies to the strings generated as
|
||||||
the result of template rendering (and email). Django will always assume UTF-8
|
the result of template rendering (and email). Django will always assume UTF-8
|
||||||
@ -214,10 +214,11 @@ bytestring or not (the result of ``__str__()`` is *always* a bytestring, even
|
|||||||
if you accidentally try to return a unicode object).
|
if you accidentally try to return a unicode object).
|
||||||
|
|
||||||
You can still create a ``__str__()`` method on your models if you wish, of
|
You can still create a ``__str__()`` method on your models if you wish, of
|
||||||
course. However, Django's ``Model`` base class automatically provides you with a ``__str__()`` method
|
course. However, Django's ``Model`` base class automatically provides you with
|
||||||
that calls your ``__unicode__()`` method and then encodes the result correctly
|
a ``__str__()`` method that calls your ``__unicode__()`` method and then
|
||||||
into UTF-8. So you would normally only create a ``__unicode__()`` method and
|
encodes the result correctly into UTF-8. So you would normally only create a
|
||||||
let Django handle the coercion to a bytestring when required.
|
``__unicode__()`` method and let Django handle the coercion to a bytestring
|
||||||
|
when required.
|
||||||
|
|
||||||
Taking care in ``get_absolute_url()``
|
Taking care in ``get_absolute_url()``
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user