Created
November 21, 2011 02:13
-
-
Save Visgean/1381414 to your computer and use it in GitHub Desktop.
including fields from one form to another form
This file contains hidden or 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 someForm(ModelForm): | |
| class Meta: | |
| model = someModel | |
| class AnotherForm(forms.Form): | |
| def __init__(self, *args, **kwargs): | |
| super(AnotherForm, self).__init__(*args, **kwargs) | |
| for name, field in someForm().fields.iteritems(): | |
| self.fields[name] = field |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment