Why "class Meta" is necessary while creating a model form?
<pre><code>from django import forms
from .models import NewsSignUp

class NewsSignUpForm(forms.ModelForm):
    class Meta:
        model = NewsSignUp
        fields = ['email', 'first_name']
here
</code></pre>

<p>This code works perfectly fine. But, when I remove <strong>"class Meta:"</strong> as below, it throws a ValueError saying "<em>ModelForm has no model class specified.</em>"</p>

<pre><code>from django import forms
from .models import NewsSignUp

class NewsSignUpForm(forms.ModelForm):
    model = NewsSignUp
    fields = ['email', 'first_name']
</code></pre>

<p>Can someone please give an explanation? :(</p>