earle/django-bootstrap — pull request #46 by mikery (2012-03-21 19:05:13+00:00)
Title: Added get_layout() function

This makes dynamic layouts a bit easier when working with form inheritance. If get_layout is not overridden, the default behaviour is used (Meta.layout if it is given, otherwise fields.keys()).

A (not very good) example:

from bootstrap.forms import BootstrapForm, Fieldset

class LoginForm(BootstrapForm):
username = forms.CharField(max_length=100)
password = forms.CharField(widget=forms.PasswordInput(), max_length=100)

def get_layout(self):
return Fieldset("Please Login", "username", "password", )