class ImageAttachmentForm(ModelForm):
class Meta:
model = ImageAttachment
fields = ['image']
field_classes = {
'image': CustomImageFormField,
}
class ImageAttachmentInline(GenericTabularInline):
form = ImageAttachmentForm
model = ImageAttachment
@admin.register(Pet)
class PetAdmin(ModelAdmin):
inlines = [ImageAttachmentInline]