title: Django ORM giving error when trying to use User with additional info
body: <p>I'm using Django 1.4 with Python 2.7 on Ubuntu 12.04.</p>
  
  <p>Edit:  I'm clearing some of the erroneous portions of this question out as it appears the same problem has re-occurred.  It was working wonderfully - I made no changes - and now it's failing.  What's up with that?</p>
  
  <p>This is basically what the views look like:</p>
  
  <pre><code>@login_required
  def request_new_project(request):
      """
      ..  function:: request_new_project()
  
          Collect information to call the form used to create a new project
  
          :param request: Django Request object
      """
      user_dict = { 'rsb_username'  : request.user.username}
      form = CreateProject(initial = user_dict)
      data = { 'user' : request.user }
      data.update(csrf(request))
      data.update({ 'form' : form })
  
      return render_to_response("create_project.html", data)
  
  @login_required
  def add_project(request):
      """
      ..  function:: add_project()
  
          Add a project for the user
  
          :param request: Django Request object
      """
  
      if (request.method == "POST"):
          user = User.objects.get(username = request.POST.get('rsb_username'))
          userProfile = UserProfile.objects.get(user = user)
  
          new_project = Projects(client = userProfile,
                                 project_name = request.POST.get('rsb_project_name'),
                                 description = request.POST.get('rsb_description'),
                                 budget = request.POST.get('rsb_budget'),
                                 time_frame = request.POST.get('rsb_time_frame'),
                                 time_frame_units = request.POST.get('rsb_time_frame_units'),
                                 contact = request.POST.get('rsb_point_of_contact'),
                                 contact_email = request.POST.get('rsb_contact_email'),
                                 contact_phone = request.POST.get('rsb_contact_phone'),
                                 price_quote = 0,
                                 eta = 'To Be Determined',
                                 current_status = 'Waiting for quote',
                                 )
          new_project.save()
          return view_projects(request)
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>Cannot assign "&lt;UserProfile: UserProfile object&gt;": "Projects.client" must be a "User" instance.
  </code></pre>
  
  <p>I didn't change the models.</p>
  
  <pre><code># Create a table for users
  class UserProfile(models.Model):
      user = models.OneToOneField(User)
  
      # Client Info
      company_name = models.CharField(max_length = 200)
      client_type = models.CharField(max_length = 200)
      address1 = models.CharField(max_length = 200)
      address2 = models.CharField(max_length = 200)
      city = models.CharField(max_length = 200)
      state = models.CharField(max_length = 200)
      country = models.CharField(max_length = 200)
      zip_code = models.CharField(max_length = 200)
      phone_number = models.CharField(max_length = 200)
  
  # Create a table to manage project requests
  class Projects(models.Model):
      client = models.ForeignKey(User)
      project_name = models.CharField(max_length = 50)
      description = models.TextField()
      budget = models.CharField(max_length = 50)
      time_frame = models.DecimalField(max_digits = 3, decimal_places = 1)
      time_frame_units = models.CharField(max_length = 25)
      contact = models.CharField(max_length = 50)
      contact_email = models.EmailField()
      contact_phone = models.CharField(max_length = 25)
      price_quote = models.DecimalField(max_digits = 10, decimal_places = 2)
      eta = models.CharField(max_length = 200)
      current_status = models.CharField(max_length = 200)
  </code></pre>
  
  <p>Any suggestions?</p>
  
  <p>UPDATE 1:
  From the actual database I can see that one of the <code>rsb_projects</code> constraints is:
  <code>rsb_projects_client_id_fkey  (client_id) REFERENCE rsb_userprofile (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED</code></p>
  
  <p>If that helps...</p>
  
  <p>It seems to me that even though I've defined the <code>ForeignKey</code> in the <code>models.py</code> to be against <code>User</code> the database wants the <code>UserProfile</code> id.</p>
  
  <p>Thoughts?</p>