Background
==========
Edit: This snippet doesn't make a lot of sense when Malcolm's blog is down.  Read on for some history, or go [here](http://www.djangosnippets.org/snippets/1955/) to see the new trick that Malcolm taught me.
A year ago, Malcolm Tredinnick put up an excellent post about doing complex Django forms [here](http://www.pointy-stick.com/blog/2008/01/06/django-tip-complex-forms/).
I ended up reinventing that wheel, and then some, in an attempt to create a complex formset.  I'm posting my (partial) solution here, in hopes that it will be useful to others.
Edit: I should have known - just as soon as I post this, Malcolm comes back with a solution to the same problem, and with slightly cleaner code.  Check out his complex formset post [here](http://www.pointy-stick.com/blog/2009/01/23/advanced-formset-usage-django/).
I'll use Malcolm's example code, with as few changes as possible to use a formset.  The models and form don't change, and the template is almost identical.
Problem
=======
In order to build a formset comprised of dynamic forms, you must build the forms outside the formset, add them, and then update the management form.  If any data (say from request.POST) is then passed to the form, it will try to create forms inside the formset, breaking the dynamically created form.
Code
====
To use this code:
* Copy `BaseDynamicFormSet` into your forms.py
* Create a derived class specific to your needs (`BaseQuizDynamicFormSet` in this example).
* Override `__init__`, and keep a reference to your object that you need to build your custom formset (`quiz`, in this case).  
* Call the parent `__init__`
* Call your custom add forms logic
* Call the parent `_defered_init`
To write your custom add_forms logic, remember these things:
* You've got to pass any bound data to your forms, and you can find it in self.data.
* You've got to construct your own unique prefixes by doing an enumerate, as shown in the example above.  This is the same way it is usually handled by the formset.
Add a `formset_factory` call, and specify your derived dynamic formset as the base formset - we now have a `QuizFormSet` class that can instantiated in our view.
The view and template code look identical to a typical formset, and all of the dynamic code is encapsulated in your custom class.
Warning
=======
This solution does not yet handle forms that work with files, use the ordering/delete features, or adding additional forms to the set via javascript.  I don't think that any of these would be that hard, but don't assume that they'll just work out of the box.