Ticket #20691: 20691.diff

File 20691.diff, 690 bytes (added by Tim Graham, 5 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.
     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
    260264Taking care in ``get_absolute_url()``
Back to Top