title: How can i compare password with retypepassword during registering/creating account without having a field 'retyppassword' in models.py?
body: <p>models.py:</p>
  
  <pre><code>class Users(models.Model):
      username = models.CharField(max_length=255)
      slug = models.CharField(max_length=255, default='0')
      password = models.CharField(max_length=300)
      passwordrepeat = models.CharField('Repeat Password', max_length=300)
      password_token = models.CharField(max_length=300, default='0')
      email = models.CharField(max_length=255)
      email_verified = models.BooleanField(default=False)
      email_token = models.CharField(max_length=255)
      email_token_expiry = models.DateTimeField(auto_now_add=True)
      tos = models.BooleanField(default=False)
      active = models.BooleanField(default=False)
      last_login = models.DateTimeField(auto_now_add=True)
      last_action = models.DateTimeField(auto_now_add=True)
      is_admin = models.BooleanField(default=False)
      role = models.CharField(max_length=255, default='0')
      created = models.DateTimeField(auto_now_add=True)
      modified = models.DateTimeField(auto_now_add=True)
  
      def __unicode__(self):
          return self.username
  
  class UsersModelForm(forms.ModelForm):
      class Meta:
          model = Users
          fields = ('username', 'password', 'passwordrepeat', 'email')
          widgets = {
              'password' : PasswordInput(),
              'passwordrepeat' : PasswordInput(),
          }
  </code></pre>
  
  <p>views.py:</p>
  
  <pre><code>def register(request):
      flag = True
      possible = '0123456789abcdefghijklmnopqrstuvwxyz'
      token = ''
      length = 10
      i = 0
  
      current_datetime = datetime.datetime.now()
  
      user = UsersModelForm()
      if request.method == 'POST':
          userf = UsersModelForm(request.POST)
          username = userf.data['username']
          password = userf.data['password']
          passwordrepeat = userf.data['passwordrepeat']
          email = userf.data['email']
  
          if password != passwordrepeat:
              flag = False
              passVariable = {'user':user, 'flag': False}
              return render_to_response('register.html', passVariable, context_instance=RequestContext(request))
  
          elif password == passwordrepeat:
              while i&lt;10:
                  temp = random.choice(possible)
                  token = token + temp
                  i=i+1
  
              userf.email_token = token
              userf.email_token_expiry = current_datetime + timedelta(1)
              userf.save()
              return HttpResponseRedirect('/')
      else:
          return render_to_response('register.html', {"user": user, 'flag': True}, context_instance=RequestContext(request))
  </code></pre>
  
  <p>In template:</p>
  
  <pre><code>&lt;div id="id_div_register"&gt;
      &lt;form action="/register" method="POST"&gt;{% csrf_token %}
          {{ user.as_p }}
          &lt;input type=submit value="Submit" /&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This form creates a textbox 'repeatpassword' because of the field in models.py. I don't want to have a field 'repeatpassword' in the mysql table field/column. But i need to compare 'password' with 'repeatpassword' in template. How can i do it?</p>
  
  <p>I need 'password' and 'repeatpassword' in template to compare these two, but i don't need a column/field 'repeatpassword' in blog_users mysql table. How can i do it? Is it possible to do it.</p>