views:

171

answers:

1

This question is somewhat linked to a question I asked previously:

http://stackoverflow.com/questions/477183/generating-and-submitting-a-dynamic-number-of-objects-in-a-form-with-django

I'm wondering, if I've got separate default values for each form within a formset, am I able to pre-populate the fields? For instance, a form requiring extra customer information to be pre-populated with the users names? In cases like adding an email field to an already existing table, and updating many of them at once.

Does Django provide an easy way to do this?

+1  A: 

Pass in a list of dicts which contain the default values you want to set for each form:

http://docs.djangoproject.com/en/dev/topics/forms/formsets/#using-initial-data-with-a-formset

insin
I read that numerous times and realis initial_data was a list of dictionaries. I'm assuming each item in the list corresponds to a form?
Josh Smeaton