title: How do I change a value in django on button click in HTML?
body: <p>I am trying to implement a function in which when I click on Activate button, the value in my Django database for this field changes to 'Active' and is displayed on the HTML page as active. If deactivate is clicked, the text changes to deactive along with it's value in the django database.</p>
  
  <p>This is my current HTML page:</p>
  
  <pre><code>   &lt;div class="col-sm-5"&gt;
      &lt;div class="panel panel-primary"&gt;
      &lt;div class="panel-heading"&gt;
         &lt;h3 class="panel-title"&gt;Job activation status&lt;/h3&gt;
      &lt;/div&gt;
         &lt;div class="panel-body"&gt;
            &lt;b&gt;Status&lt;/b&gt;: Active
            &lt;span style="padding-left:20px;"&gt;&lt;/span&gt;
            &lt;button type="button" class="btn btn-primary"&gt;Activate&lt;/button&gt;
            &lt;button type="button" class="btn btn-primary"&gt;Deactivate&lt;/button&gt;
            &lt;button type="button" class="btn btn-primary"&gt;Dissolve&lt;/button&gt;
  
        &lt;/div&gt;
       &lt;/div&gt;
       &lt;/div&gt;
  </code></pre>
  
  <p>And my models.py is as follows:</p>
  
  <pre><code>class Job(models.Model):
      def __unicode__(self):
          return self.name
      name = models.CharField('Job Name',max_length=128)
      # when the job was created
      date_created = models.DateTimeField('Date Created', auto_now=True)
      # what entity/organization needs this job?
      client_organization = models.CharField('What organization do you represent?', max_length=64)
      # short description
      description = models.TextField('Job Description', max_length=256)
      # end product to be delivered
      deliverable = models.TextField('Deliverable', max_length=256)
      # when Job is due for completion
      duedate = models.DateTimeField('Date Due')
      # all persons who may be affected by project
      #stakeholders = models.TextField('Stakeholders')
      # important technical requirements
      #additional_information = models.TextField('Additional Information', blank = True)
      # budget estimate
      #budget = models.CharField('Budget', max_length=64)
      # file attachments
      #attachments = models.FileField(upload_to='job', blank = True)
      creator = models.ForeignKey(User,related_name = 'jobs')
      organizations = models.ManyToManyField(Organization, through = 'JobRequest', blank=False, null=True)
      #organizations = models.CharField(default="nothing",null=True,max_length = 256)
      contact_information = models.CharField('Contact Information', max_length = 256, blank = False, null=True)
      skill_required = models.CharField('Volunteer skills required', max_length=256, blank = False, null=True)
      hours_day = models.CharField('Number of hours per day', max_length=256, blank = False, null=True)
      #  Job is closed after a jr is confirmed
      closed = models.BooleanField(default = False)
      # some tags to determine what organizations to submit job to
      categories = models.ManyToManyField(Category, related_name = 'jobs')
      #categories = models.CharField(default="nothing",null=True, max_length = 256)
      status = models.IntegerField(default = 0, choices = ((0, 'Pending'), (1, 'Approved'), (2, 'Disapproved'), (3, 'Closed')))
      class Meta:
         permissions = (
             ( 'view_job','Can view Job' ),
             ( 'edit_job','Can edit Job'),
             ( 'is_creator', 'Is a creator of Job')
             )
  </code></pre>
  
  <p>I need help in adding a field to models.py which changes according to the button click in HTML and displays active/ deactive in the HTML page according to the button clicked. I also need help in modifying the HTML page accordingly </p>