From 7442eb1a242ecf9d186d4e7de1b94e360e04782d Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Thu, 4 Jul 2013 15:19:33 +0200 Subject: Fixed #20224 -- Update docs examples which mention __unicode__ Thanks Marc Tamlyn and Tim Graham for the review. --- docs/ref/forms/api.txt | 3 ++- docs/ref/forms/fields.txt | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'docs/ref/forms') diff --git a/docs/ref/forms/api.txt b/docs/ref/forms/api.txt index aa19719a68..5d54e01c3d 100644 --- a/docs/ref/forms/api.txt +++ b/docs/ref/forms/api.txt @@ -566,7 +566,8 @@ Customizing the error list format By default, forms use ``django.forms.util.ErrorList`` to format validation errors. If you'd like to use an alternate class for displaying errors, you can -pass that in at construction time:: +pass that in at construction time (replace ``__unicode__`` by ``__str__`` on +Python 3):: >>> from django.forms.util import ErrorList >>> class DivErrorList(ErrorList): diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt index 69e3aa71ad..ef4ed729bd 100644 --- a/docs/ref/forms/fields.txt +++ b/docs/ref/forms/fields.txt @@ -1000,12 +1000,12 @@ objects (in the case of ``ModelMultipleChoiceField``) into the initial value, no empty choice is created (regardless of the value of ``empty_label``). - The ``__unicode__`` method of the model will be called to generate - string representations of the objects for use in the field's choices; - to provide customized representations, subclass ``ModelChoiceField`` - and override ``label_from_instance``. This method will receive a model - object, and should return a string suitable for representing it. For - example:: + The ``__unicode__`` (``__str__`` on Python 3) method of the model will be + called to generate string representations of the objects for use in the + field's choices; to provide customized representations, subclass + ``ModelChoiceField`` and override ``label_from_instance``. This method will + receive a model object, and should return a string suitable for representing + it. For example:: from django.forms import ModelChoiceField -- cgit v1.3