Skip to content

Instantly share code, notes, and snippets.

@Visgean
Created November 21, 2011 02:13
Show Gist options
  • Select an option

  • Save Visgean/1381414 to your computer and use it in GitHub Desktop.

Select an option

Save Visgean/1381414 to your computer and use it in GitHub Desktop.
including fields from one form to another form
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