Fix custom image docs to indicate that fields must be non-required

pull/2027/merge
Matt Westcott 2016-01-12 19:35:00 +00:00 zatwierdzone przez Karl Hobley
rodzic f249aba6ef
commit 6851bbf1a6
1 zmienionych plików z 8 dodań i 1 usunięć

Wyświetl plik

@ -31,7 +31,7 @@ Here's an example:
# Add any extra fields to image here
# eg. To add a caption field:
# caption = models.CharField(max_length=255)
# caption = models.CharField(max_length=255, blank=True)
admin_form_fields = Image.admin_form_fields + (
# Then add the field names here to make them appear in the form:
@ -59,6 +59,13 @@ Here's an example:
def rendition_delete(sender, instance, **kwargs):
instance.file.delete(False)
.. note::
Fields defined on a custom image model must either be set as non-required
(``blank=True``), or specify a default value - this is because uploading
the image and entering custom data happen as two separate actions, and
Wagtail needs to be able to create an image record immediately on upload.
.. note::
If you are using image feature detection, follow these instructions to