mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-25 23:33:45 +00:00
Document admin_form_fields
This commit is contained in:
parent
c670f1a8e7
commit
afda401956
1 changed files with 6 additions and 1 deletions
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Reference in a new issue