You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to choose a created form through WagtailFormBlock() using ChoiceBlock and then export the selected form through API fields.
Code for ChoiceBlock is as below -
def getFormblockChoices():
choices = []
forms = Form.objects.all()
for form in forms:
choices.append((form.id, form.title))
return choices
class WagtailFormBlock(blocks.StructBlock):
# FORMBLOCK_CHOICES = getFormblockChoices()
form = blocks.ChoiceBlock(choices=getFormblockChoices, required=False)
form_action = blocks.CharBlock(
required=False,
help_text=(
'The form post action. "" or "." for the current page or a url'))
form_reference = InfoBlock(
required=False,
help_text=("This form will be given a unique reference once saved"), )
However, I am able to choose a form and publish the page but the fields are not visible through API.
Please let me know.
The text was updated successfully, but these errors were encountered:
Hi All,
I am trying to choose a created form through WagtailFormBlock() using ChoiceBlock and then export the selected form through API fields.
Code for ChoiceBlock is as below -
def getFormblockChoices():
choices = []
forms = Form.objects.all()
for form in forms:
choices.append((form.id, form.title))
return choices
class WagtailFormBlock(blocks.StructBlock):
# FORMBLOCK_CHOICES = getFormblockChoices()
form = blocks.ChoiceBlock(choices=getFormblockChoices, required=False)
form_action = blocks.CharBlock(
required=False,
help_text=(
'The form post action. "" or "." for the current page or a url'))
form_reference = InfoBlock(
required=False,
help_text=("This form will be given a unique reference once saved"), )
However, I am able to choose a form and publish the page but the fields are not visible through API.
Please let me know.
The text was updated successfully, but these errors were encountered: