From afda401956882c101158ed807fee81b5b995d066 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Fri, 29 May 2015 11:57:25 +0100 Subject: [PATCH] Document admin_form_fields --- docs/topics/images/advanced_topics.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/topics/images/advanced_topics.rst b/docs/topics/images/advanced_topics.rst index 8c84a3c6e..95ef380ce 100644 --- a/docs/topics/images/advanced_topics.rst +++ b/docs/topics/images/advanced_topics.rst @@ -28,7 +28,7 @@ Here's an example: from django.db.models.signals import pre_delete from django.dispatch import receiver - from wagtail.wagtailimages.models import AbstractImage, AbstractRendition + from wagtail.wagtailimages.models import Image, AbstractImage, AbstractRendition class CustomImage(AbstractImage): @@ -37,6 +37,11 @@ Here's an example: # eg. To add a caption field: # caption = models.CharField(max_length=255) + admin_form_fields = Image.admin_form_fields + ( + # Then add the field names here to make them appear in the form: + # 'caption', + ) + class CustomRendition(AbstractRendition): image = models.ForeignKey(CustomImage, related_name='renditions')