Remove Python 2 references from docs

This commit is contained in:
Matt Westcott 2017-10-13 11:39:26 +01:00
parent a789ec7b7f
commit 5f382d8784
3 changed files with 3 additions and 8 deletions

View file

@ -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 <http://localhost:8080/> in your web browser to see the compiled documentation.

View file

@ -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 its perfectly OK to do
this:

View file

@ -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)