0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

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

This commit is contained in:
Matt Westcott 2016-01-12 19:35:00 +00:00 committed by Karl Hobley
parent f249aba6ef
commit 6851bbf1a6

View File

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