I'm looking for an updated version of these Django SuperForms. Can't seem to get it to work in Django 1.2. In particular, I'd like it to work with ModelForms.
My use case is almost identical to his; I have an Address model that I'd like to use as a sub-form in various places. It's a pain to try and combine everything in the view func.
I've updated superforms.py to work w/1.2, and attached it to the ticket you linked to: http://code.djangoproject.com/attachment/ticket/3706/superform.2.py
There's a project I'm working on that could benefit from this, so I figured I'd spend the time and help you out as well.
Keep in mind that I just got this to work w/1.2, and didn't really try to clean up the internals. Now that I have test cases proving the API, I can go back and clean that up later.
If you're using it with ModelForms and you'd like the save() functionality you'll have to override the method on your SuperForm class.
I currently have it locally in my "common" repository w/~90% code coverage that covers multiple SubForms, mixed SubForms & declared forms, and ModelForms. I've included the test cases below (beware it uses my
TestCaseBaseclass, but this should give you the gist of the API). Let me know if you have questions, or any areas I missed.Enjoy!