Created
September 3, 2017 12:08
-
-
Save lb-/a3c6b8c0c3f2f0fd2574ed8cc29afd94 to your computer and use it in GitHub Desktop.
Wagtail Forms - Upload Image Field - Extend FormBuilder 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.forms import FormBuilder | |
from wagtail.wagtailimages.fields import WagtailImageField | |
class ExtendedFormBuilder(FormBuilder): | |
def create_image_upload_field(self, field, options): | |
return WagtailImageField(**options) | |
FIELD_TYPES = FormBuilder.FIELD_TYPES | |
FIELD_TYPES.update({ | |
'image': create_image_upload_field, | |
}) |
ChiragKanzariya
commented
Aug 23, 2019
via email
Ok thank you I got it how to do it
…On Fri, 23 Aug, 2019, 12:56 PM LB (Ben Johnston), ***@***.***> wrote:
Hi @ChiragKanzariya <https://github.com/ChiragKanzariya> - I don't have
an updated example sorry but you can view all the Wagtail source code on
their repo.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://gist.github.com/a3c6b8c0c3f2f0fd2574ed8cc29afd94?email_source=notifications&email_token=ALGRQZB6CRVDC6JKIFRLWG3QF6GJ3A5CNFSM4IGMVMC2YY3PNVWWK3TUL52HS4DFVNDWS43UINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAFXPLA#gistcomment-3006128>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALGRQZD7GIN6BRMPRPBHYULQF6GJ3ANCNFSM4IGMVMCQ>
.
@ChiragKanzariya - awesome, if you don't mind, can you share the repo (if on github) or paste the relevant part of your code here.
This will help me and others work through this in the future, plus helps me if I get the time to write a new blog post about this.
Write now I am in vacation so i will do it on Monday.
…On Sat, 24 Aug, 2019, 7:14 AM LB (Ben Johnston), ***@***.***> wrote:
@ChiragKanzariya <https://github.com/ChiragKanzariya> - awesome, if you
don't mind, can you share the repo (if on github) or paste the relevant
part of your code here.
This will help me and others work through this in the future, plus helps
me if I get the time to write a new blog post about this.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://gist.github.com/a3c6b8c0c3f2f0fd2574ed8cc29afd94?email_source=notifications&email_token=ALGRQZC2TGPCFDRR3JMWPQLQGCG7ZA5CNFSM4IGMVMC2YY3PNVWWK3TUL52HS4DFVNDWS43UINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAFXQXA#gistcomment-3006832>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALGRQZCV5JRY3QE3HOLBGPTQGCG7ZANCNFSM4IGMVMCQ>
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment