title: "Unknown column 'user_id' error in django view
body: <p>I'm having an error where I am not sure what caused it.</p>
  
  <p>Here is the error:</p>
  
  <pre><code>Exception Type:     OperationalError
  Exception Value:    
  (1054, "Unknown column 'user_id' in 'field list'")
  </code></pre>
  
  <p>Does anyone know why I am getting this error? I can't figure it out. Everything seems to be fine. </p>
  
  <p>My view code is below:</p>
  
  <pre><code>if "login" in request.session:
      t = request.POST.get('title', '')
      d = request.POST.get('description', '')
      fid = request.session["login"]
      fuser = User.objects.get(id=fid)
      i = Idea(user=fuser, title=t, description=d, num_votes=1)
      i.save()
      return HttpResponse("true", mimetype="text/plain")
  else:
      return HttpResponse("false", mimetype="text/plain")
  </code></pre>
  
  <p>I appreciate any help! Thanks!</p>
  
  <p>Edit: Also a side question. Do I use objects.get(id= or objects.get(pk= ?   If I use a primary key, do I need to declare an id field or an index in the model?</p>
  
  <p>Edit: Here are the relevant models:</p>
  
  <pre><code>class User (models.Model):
      first_name = models.CharField(max_length=200)
      last_name = models.CharField(max_length=200)
      email = models.CharField(max_length=200)
      password = models.CharField(max_length=200)
  
  class Idea (models.Model):
      user = models.ForeignKey(User)
      title = models.CharField(max_length=200)
      description = models.CharField(max_length=255)
      num_votes = models.IntegerField()
  </code></pre>