Ticket #20691: 20691.diff

File 20691.diff, 690 bytes (added by Tim Graham, 4 years ago)
  • docs/ref/unicode.txt

    diff --git a/docs/ref/unicode.txt b/docs/ref/unicode.txt
    index e507428..aa90e22 100644
    a b implementation that calls ``__unicode__()`` and encodes the result into UTF-8. 
    257257This means you'll normally only need to implement a ``__unicode__()`` method
    258258and let Django handle the coercion to a bytestring when required.
    259259
     260On Python 3, you should use ``__str__()`` instead of of ``__unicode__()``. If
     261you'd like compatibility with Python 2, you can decorate your model class with
     262:func:`~django.utils.encoding.python_2_unicode_compatible`.
     263
    260264Taking care in ``get_absolute_url()``
    261265-------------------------------------
    262266
Back to Top