title: Django: what do model and fields do in meta class?
body: <p>I am following the Django tutorial series from &quot;trydjango: coding for enterpreneurs&quot;, and was confused about what &quot;model&quot; and &quot;field&quot; do in a Django form.</p>
  <p><strong>models.py</strong></p>
  <pre><code>from django.db import models
  # Create your models here.
  class SignUp(models.Model):
      email=models.EmailField()
      full_name=models.CharField(max_length=55, blank=True, null=True)
      timestamp = models.DateTimeField(auto_now_add=True, auto_now=False)
      updated=models.DateTimeField(auto_now_add=False, auto_now=True)
  
      def __unicode__(self):
          return self.email
  </code></pre>
  <p><strong>forms.py</strong></p>
  <pre><code>from django import forms
  from .models import SignUp
  
  class SignUpForm(forms.ModelForm):
      class Meta:
          model=SignUp   # ?
          fields=['full_name','email']  # ?
  
      def clean_email(self):
          email=self.cleaned_data.get('email')
          email_base,provider=email.split(&quot;@&quot;)
          domain,extension=provider.split(&quot;.&quot;)
          if not domain == 'USC':
              raise forms.ValidationError(&quot;Please make sure you use your USC email&quot;)
          if not extension == &quot;edu&quot;:
              raise forms.ValidationError(&quot;Please use valide edu address&quot;)
          return email
  
      def clean_full_name(self):
          full_name = self.cleaned_data.get('full_name')
          #write validation code
          return full_name
  </code></pre>