darklow/django-suit — pull request #45 by phihos (2013-03-21 03:57:40+00:00)
Title: Added basic mapping of fieldsets to tabs

As already mentioned in #32 there is a lack of flexibility in creating forms in tabs. So I took your example of the country change_form and made a new template: tabbed_change_form. It is located in suit/tabbed_change_form.html.
I also subclassed ModelAdmin and called it TabbedModelAdmin.
When used instead of ModelsAdmin, every fieldset and inline formset gets its own tab.
The tabs can be extended by overwriting the blocks nav_tabs and after_related_objects.

There are still some rough edges:

* I am not sure wether subclassing ModelAdmin is the best solution (maybe a mixin?)
* due to changes I had to make in change_form (removing the main tab div) the country example won't work anymore, but can be adapted to look like before (maybe tabbed_change_list should not extend change_form?)

But I hope you get the idea ;-)