diff --git a/docs/contributing/developing.rst b/docs/contributing/developing.rst index 0a8f55703..6781803a0 100644 --- a/docs/contributing/developing.rst +++ b/docs/contributing/developing.rst @@ -194,10 +194,7 @@ To start this simple server, run the following commands: .. code-block:: console $ cd docs/_build/html/ - $ # Python 2 - $ python2 -mSimpleHTTPServer 8080 - $ # Python 3 - $ python3 -mhttp.server 8080 + $ python -mhttp.server 8080 Now you can open in your web browser to see the compiled documentation. diff --git a/docs/reference/contrib/modeladmin/indexview.rst b/docs/reference/contrib/modeladmin/indexview.rst index e5506b3cc..95cc791bf 100644 --- a/docs/reference/contrib/modeladmin/indexview.rst +++ b/docs/reference/contrib/modeladmin/indexview.rst @@ -91,7 +91,7 @@ You have three possible values that can be used in list_display: A few special cases to note about ``list_display``: - If the field is a ``ForeignKey``, Django will display the output of - ``__str__()`` (``__unicode__()`` on Python 2) of the related object. + ``__str__()`` of the related object. - If the string provided is a method of the model or ``ModelAdmin`` class, Django will HTML-escape the output by default. To escape user input and @@ -163,7 +163,7 @@ A few special cases to note about ``list_display``: return super(self, PersonAdmin).get_empty_value_display(field_name) - The ``__str__()`` (``__unicode__()`` on Python 2) method is just as valid + The ``__str__()`` method is just as valid in ``list_display`` as any other model method, so it’s perfectly OK to do this: diff --git a/docs/topics/snippets.rst b/docs/topics/snippets.rst index 1e88b3cd8..3656547cd 100644 --- a/docs/topics/snippets.rst +++ b/docs/topics/snippets.rst @@ -16,7 +16,6 @@ Here's an example snippet model: .. code-block:: python from django.db import models - from django.utils.encoding import python_2_unicode_compatible from wagtail.wagtailadmin.edit_handlers import FieldPanel from wagtail.wagtailsnippets.models import register_snippet @@ -24,7 +23,6 @@ Here's an example snippet model: ... @register_snippet - @python_2_unicode_compatible # provide equivalent __unicode__ and __str__ methods on Python 2 class Advert(models.Model): url = models.URLField(null=True, blank=True) text = models.CharField(max_length=255)