Created
November 23, 2012 19:40
-
-
Save ckinsey/4136999 to your computer and use it in GitHub Desktop.
Formset magic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DashboardManageUsersFormset(BaseFormSet): | |
def __init__(self, *args, **kwargs): | |
self.assignment_perms = kwargs.pop('assignment_perms', None) | |
super(DashboardManageUsersFormset, self).__init__(*args, **kwargs) | |
def _construct_forms(self): | |
self.forms = [] | |
for i in xrange(self.total_form_count()): | |
self.forms.append(self._construct_form(i, assignment_perms=self.assignment_perms)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment