title: Created a modelform in django, primary key is missing
body: <p>I created a modelform in django, but the primary key field is missing in the browser. Where is it? How can I get it to appear. Let me know if you need more code than what I have below.</p>
  
  <p><strong>view.py</strong></p>
  
  <pre><code>import autocomplete_light
  import datetime
  
  from django.shortcuts import render, render_to_response, RequestContext
  from django.http import HttpResponseRedirect
  from django.utils.timezone import utc
  from django.contrib.auth.decorators import login_required
  
  from error_tracking.models import Incident
  
  from django.contrib.auth import authenticate
  from django.contrib.auth.models import User
  
  from haystack.query import SearchQuerySet
  from error_tracking.forms import IncidentForm
  
  
  @login_required
  def search_incidents(request):
  
      # form validation
      if request.method == 'POST':
          form = autocomplete_light.IncidentForm(request.POST)
          if form.is_valid():
              form.save()
              return HttpResponseRedirect('/')
      else:
          form = IncidentForm()
  
      # grabbing all OPEN incidents
      incident_list = Incident.objects.filter(open = 'True').order_by('-incident_date_time_reported')
  
      return render(request, 'search_incidents.html', { 
          'incident_list' : incident_list,
          'user' : request.user,
          'form' : form
      })
  </code></pre>
  
  <p><strong>forms.py</strong></p>
  
  <pre><code>import autocomplete_light
  from django.forms import ModelForm
  
  from error_tracking.models import Incident
  
  autocomplete_light.register(Incident, search_fields=['incident_id'])
  
  class IncidentForm(autocomplete_light.ModelForm):
      class Meta:
          model = Incident
          fields = ['incident_id', 'user_id', 'equipment_id', 'incident_category', 'incident_date_time_reported', 'incident_date_time_occurred', 'description']
  </code></pre>
  
  <p><strong>models.py</strong></p>
  
  <pre><code>from django.db import models
  from django.contrib.auth.models import User
  from django.utils import timezone
  
  
  class Manufacturer(models.Model):
          manufacturer = models.CharField(primary_key=True, max_length=100)
  
          def __str__(self):
                  return self.manufacturer
  
          class Meta:
                  verbose_name_plural="Manufacturer"
  
  class Equipment_Category(models.Model):
          equipment_category = models.CharField(primary_key=True, max_length=100)
  
          def __str__(self):
                  return self.equipment_category
  
          class Meta:
                  verbose_name_plural="Equipment Category"
  
  class Equipment(models.Model):
          product_id = models.CharField(primary_key=True,max_length=100)
          manufacturer = models.ForeignKey(Manufacturer)
          equipment_category = models.ForeignKey(Equipment_Category)
          validated= models.BooleanField(default=True)
          in_service_date = models.DateTimeField('in service date', default=timezone.now)
  
          def __str__(self):
                 return self.product_id
  
          class Meta:
                 verbose_name_plural="Equipment"
  
  class Incident_Category(models.Model):
          incident_category = models.CharField(primary_key=True,max_length=100)
          description = models.CharField(max_length=100)
  
          def __str__(self):
                 return self.incident_category
  
          class Meta:
                  verbose_name_plural="Incident Category"
  
  class Incident(models.Model):
         incident_id = models.AutoField(primary_key=True)
         incident_date_time_reported = models.DateTimeField('incident reported', default=timezone.now)
         user_id = models.ForeignKey(User)
         incident_date_time_occurred = models.DateTimeField('incident occurred', default=timezone.now)
         clinical_sample = models.BooleanField(default=True)
         number_of_clinical_samples = models.IntegerField(default=0)
         sample_id_numbers = models.TextField(max_length=1000)
         equipment_id = models.ForeignKey(Equipment)
         incident_category = models.ForeignKey(Incident_Category)
         technician = models.TextField(max_length=1000)
         description = models.TextField(max_length=1000)
         action_taken = models.TextField(max_length=1000)
         open = models.BooleanField(default=True)
  
         def __str__(self):
                 return self.incident_id
  
         class Meta:
                 verbose_name_plural="Incident"
  </code></pre>
  
  <p><strong>search_incidents.html</strong></p>
  
  <pre><code>{% extends "base.html" %}
  
  {% block content %}
  &lt;br&gt;
  &lt;p&gt;Not only have you successfully logged in, you have also made it to the Search Incidents page using html templates&lt;/p&gt;
  &lt;br&gt;&lt;br&gt;
  
  
  &lt;!--incident_id--&gt;
  &lt;!--CAPA number--&gt;
  &lt;!--Date From To--&gt;
  &lt;!--Creator--&gt;
  &lt;!--Status--&gt;
  &lt;!--Category--&gt;
  &lt;!--Equipment ID--&gt;
  &lt;!--Search Description--&gt;
  &lt;!--error_tracking.views.search_usernames--&gt;
  
  &lt;form method='POST' action=''&gt;{% csrf_token %}
      {{ form.as_p }}
      &lt;input type="submit"/&gt;
  &lt;/form&gt;
  
  
  &lt;div id="table-wrapper" style="overflow:auto; height:600px;"&gt;
      &lt;table class="table table-striped"&gt;
          &lt;thead&gt;
          &lt;tr&gt;
              &lt;th class="col-md-1"&gt;ID&lt;/th&gt;
              &lt;th class="col-md-1"&gt;Open&lt;/th&gt;
              &lt;th class="col-md-2"&gt;Created At&lt;/th&gt;
              &lt;th class="col-md-1"&gt;Category&lt;/th&gt;
              &lt;th class="col-md-7"&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
          {% for incident in incident_list %}
          &lt;tr&gt;
              &lt;td class="col-md-1"&gt;{{ incident.incident_id }}&lt;/td&gt;
              &lt;td class="col-md-1"&gt;{{ incident.open }}&lt;/td&gt;
              &lt;td class="col-md-2"&gt;{{ incident.incident_date_time_reported }}&lt;/td&gt;
              &lt;td class="col-md-1"&gt;{{ incident.incident_category }}&lt;/td&gt;
              &lt;td class="col-md-7"&gt;{{ incident.description}}&lt;/td&gt;
          &lt;/tr&gt;
          {% endfor %}
          &lt;/tbody&gt;
      &lt;/table&gt;
  &lt;/div&gt;
  {% endblock %}
  </code></pre>