-
Notifications
You must be signed in to change notification settings - Fork 417
Open
Description
Hi
with Django Form is it possible to do something like
ParagraphsFormSet = forms.formset_factory(ParagraphsForm, extra=2, can_delete=True)
formset = ParagraphsFormSet(initial=[
{'paragraph_title': 'Django is now open source',
'paragraph_content': "datetime.date.today()",}
])
or
initial_list = [
{'paragraph_title': 'Title 1', 'paragraph_content':"Content 1"},
{'paragraph_title': 'Title 2', 'paragraph_content':"Content 2"},
{'paragraph_title': 'Title 3', 'paragraph_content':"Content 3"},
{'paragraph_title': 'Title 4', 'paragraph_content':"Content 4"},
{'paragraph_title': 'Title 5', 'paragraph_content':"Content 5"},
]
ParagraphsFormSet = forms.formset_factory(ParagraphsForm, extra=2, can_delete=True)
formset = ParagraphsFormSet(initial=initial_list)
and use formset prefilled
I'm trying to achieve the same with Viewflow formset
ParagraphsFormSet = forms.formset_factory(ParagraphsForm, extra=2, can_delete=True)
paragraphs = FormSetField(formset_class=ParagraphsFormSet, )
layout = Layout(
FormSet("paragraphs",card_desktop=12),
)
but nothing seams to work
FormSet cannot have initial
FormSetField no error with initial but no output
any suggestion?
Reactions are currently unavailable