title: 'User' object has no attribute '__getitem__' on create object
body: <p>Trying to insert data into a python model with a foreign key using the create object and getting a 'User' object has no attribute '<strong>getitem</strong>'</p>
  
  <p>models.py</p>
  
  <p>from <strong>future</strong> import unicode_literals
      from django.db import models
      from ..loginRegistration_app.models import User</p>
  
  <pre><code>class PostManager(models.Manager):
      error_list = []
      def post_in(self, postData, user_id):
          if len(postData['post']) &lt; 1:
              context = {'status':0}
              return context
          else:
              curr_user = User.objects.get(id = user_id)
              # print curr_user.last_name
              self.create(secrets = postData['post'], users_id = curr_user['id'])
  
  class Like(models.Model):
      like = models.BooleanField()
      users = models.ForeignKey(User, related_name = 'user_likes')
      created_at = models.DateTimeField(auto_now_add = True)
      upated_at = models.DateTimeField(auto_now = True)
  
  class Secret(models.Model):
      secret = models.TextField(max_length = 1000)
      likes = models.ForeignKey(Like, related_name = 'all_likes')
      users = models.ForeignKey(User, related_name = 'user_secrets')
      created_at = models.DateTimeField(auto_now_add = True)
      upated_at = models.DateTimeField(auto_now = True)
  
      objects = PostManager()
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>from django.shortcuts import render, redirect
  from .models import Secret
  from django.contrib import messages
  
  def index(request):
      if 'user_id' not in request.session:
          return redirect('main:home')
      # put query to display most recent secrets
  
      return render(request, 'dojo_secrets_app/index.html')
  
  def post_it(request):
      post_this = Secret.objects.post_in(request.POST, request.session['user_id'])
      return redirect('secrets:home')
  </code></pre>
  
  <p>error:</p>
  
  <pre><code>TypeError at /secrets/post_it
  'User' object has no attribute '__getitem__'
  
  self.create(secrets = postData['post'], users_id = curr_user['id']) 
  </code></pre>