Django forms split based on model type
models.py
TYPE = (
('general', 'General'),
('category2', 'Category2'),
)
class Test(models.Model):
type = models.CharField(max_length=765, choices=TYPE)
forms.py
class TestForm(ModelForm):
class Meta:
model = Test
Is it possible to split the form based on "type", make 2 separate forms based on model type
TestFormGeneral
TestFormCategory2
Update
models.py
class TestImport(models.Model):
tests = models.ForeignKey(Test))
The above model pull out all the entries in forms, would like to restrict them based on type, rather than displaying the entire contents.