1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Refs #27795 -- Replaced many force_text() with str()

Thanks Tim Graham for the review.
This commit is contained in:
Claude Paroz
2017-04-21 19:52:26 +02:00
parent 8ab7ce8558
commit 301de774c2
47 changed files with 135 additions and 181 deletions

View File

@@ -706,10 +706,10 @@ smoothly:
2. Put a ``__str__()`` method on the class you're wrapping up as a field. There
are a lot of places where the default behavior of the field code is to call
:func:`~django.utils.encoding.force_text` on the value. (In our
examples in this document, ``value`` would be a ``Hand`` instance, not a
``HandField``). So if your ``__str__()`` method automatically converts to
the string form of your Python object, you can save yourself a lot of work.
``str()`` on the value. (In our examples in this document, ``value`` would
be a ``Hand`` instance, not a ``HandField``). So if your ``__str__()``
method automatically converts to the string form of your Python object, you
can save yourself a lot of work.
Writing a ``FileField`` subclass
================================