Add missing null=True and imports to modeladmin example code

pull/4987/head
Matt Westcott 2019-01-10 10:40:33 +00:00 zatwierdzone przez Matt Westcott
rodzic 5e5484d4d7
commit d731ea6c9f
1 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -80,11 +80,16 @@ to create, view, and edit ``Book`` entries.
.. code-block:: python
from django.db import models
from wagtail.admin.edit_handlers import FieldPanel
from wagtail.images.edit_handlers import ImageChooserPanel
class Book(models.Model):
title = models.CharField(max_length=255)
author = models.CharField(max_length=255)
cover_photo = models.ForeignKey(
'wagtailimages.Image',
null=True, blank=True,
on_delete=models.SET_NULL,
related_name='+'
)