Here's an example:
from django import forms
class ArticleForm(forms.Form):
title = forms.CharField()
pub_date = forms.DateField()
from django.forms.formsets import formset_factory
ArticleFormSet = formset_factory(ArticleForm)
formset = ArticleFormSet(initial=my_data)
So 'my_data' in the example is the data I want to form to show when it is first loaded before any user input. But I'd like to go ahead and run the form's validation on the data so the user can see if there are any existing errors before they edit the data.
I tried doing this:
formset = ArticleFormSet(initial=my_data)
formset.is_valid()
But it didn't help.