Created
September 3, 2017 12:02
-
-
Save lb-/d51a9e5f46b0281a514e1c6c1196c8cf to your computer and use it in GitHub Desktop.
Wagtail Forms - Upload Image Field - Extend AbstractFormField Class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from wagtail.wagtailforms.models import AbstractFormField, FORM_FIELD_CHOICES | |
class FormField(AbstractFormField): | |
FORM_FIELD_CHOICES = list(FORM_FIELD_CHOICES) + [('image', 'Upload Image')] | |
field_type = models.CharField( | |
verbose_name=_('field type'), | |
max_length=16, | |
choices=FORM_FIELD_CHOICES) | |
page = ParentalKey('FormPage', related_name='form_fields') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment