How would it be more correct to copy the fields from the model or to describe the form with the fields in a new way? Or it all depends on the case how to use the form?

class TestForm(ModelForm): class Meta: model = Testtest class TestForm(forms.Form): term = forms.CharField(max_length=10) 

    2 answers 2

    You probably can't think of a “correct” one here, everything depends on the case. It is very convenient to use forms based on models - read about 'exclude', 'fields', etc., this is a very powerful tool. But this is not a panacea.

      The so-called ModelForms are very flexible - by default, the fields are "inherited" from the model, the documentation indicates how (in which types of Form fields) the Model fields are converted.
      You can exclude fields from the form, or explicitly describe the required list (as Sergey wrote above), and if you need additional fields that the model did not have, you can easily describe them, as in the usual form.