Fixed #20224 -- Update docs examples which mention __unicode__

Thanks Marc Tamlyn and Tim Graham for the review.
This commit is contained in:
Claude Paroz 2013-07-04 15:19:33 +02:00
parent 577b0f9189
commit 7442eb1a24
24 changed files with 65 additions and 24 deletions

View file

@ -124,13 +124,16 @@ Model style
first_name = models.CharField(max_length=20)
last_name = models.CharField(max_length=40)
* If you define a ``__str__`` method (previously ``__unicode__`` before Python 3
was supported), decorate the model class with
:func:`~django.utils.encoding.python_2_unicode_compatible`.
* The order of model inner classes and standard methods should be as
follows (noting that these are not all required):
* All database fields
* Custom manager attributes
* ``class Meta``
* ``def __unicode__()``
* ``def __str__()``
* ``def save()``
* ``def get_absolute_url()``