Say I have two different models like...
class Model1(models.Model):
field1 = models.CharField(max_length=32)
field2 = models.CharField(max_length=16)
class Model2(models.Model):
field3 = models.CharField(max_length=32)
field4 = models.CharField(max_length=16)
However, upon a sign up form for example I want them to input information that corresponds to field1, field2 and field3 of course which spreads over two separate models.
forms.py
class Form1 (forms.ModelForm):
...
class Meta:
model = Model1, Model2 #note that this does not work...:(
fields = ['field1', 'field2', 'field3']
How can I get this to work so that I can receive data from two different models on the same one form?