diff --git a/docs/advanced_topics/images/custom_image_model.rst b/docs/advanced_topics/images/custom_image_model.rst index 5ea4124245..032032f917 100644 --- a/docs/advanced_topics/images/custom_image_model.rst +++ b/docs/advanced_topics/images/custom_image_model.rst @@ -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