title: Django Rest framework - generic view
body: <p>I am learn Django and Django REST framework.
  I'm trying to do API and add permissions to view.</p>
  
  <p>from django.db import models
  from django.contrib.auth.models import User</p>
  
  <p>My models:</p>
  
  <pre><code>class Profile(models.Model):
      nickname = models.CharField(max_length=100)
      # Relations
      user = models.OneToOneField(User)
  
  class Word(models.Model):
      value = models.CharField(max_length=100)
      user = models.ForeignKey(User, related_name='word')
  </code></pre>
  
  <p>My serialazer:</p>
  
  <pre><code>from rest_framework import serializers
  from myapp.models import Profile, Word
  from django.contrib.auth.models import User
  
  class ProfileSerializer(serializers.ModelSerializer):
      user = serializers.PrimaryKeyRelatedField()
  
      class Meta:
          model = Profile
  
          fields = ('id', 'nickname', 'user')
  
  
  class UserSerializer(serializers.ModelSerializer):
      profile = serializers.PrimaryKeyRelatedField()
  
      class Meta:
          model = User
  
          fields = ('id', 'username', 'profile')
  
  
  class WordSerializer(serializers.ModelSerializer):
      user = serializers.PrimaryKeyRelatedField(many=True)
  
      class Meta:
          model = Word
  
          fields = ('id', 'value', 'user')
  </code></pre>
  
  <p>My Views:</p>
  
  <pre><code>class WordList(generics.ListCreateAPIView):
      queryset = Word.objects.all()
      serializer_class = WordSerializer
  
  
  class WordDetail(generics.RetrieveUpdateAPIView):
      queryset = Word.objects.all()
      serializer_class = WordSerializer
  </code></pre>
  
  <p><strong>when I try add new "word" - show error:</strong></p>
  
  <pre><code>Cannot assign "[]": "Word.user" must be a "User" instance.
  Request Method: POST
  Request URL:    http://127.0.0.1:8080/api/words/
  Django Version: 1.6.2
  Exception Type: ValueError
  Exception Value:    
  Cannot assign "[]": "Word.user" must be a "User" instance.
  Exception Location: /home/mikhail/virtualenv/test/lib/python3.3/site-packages/django/db/models/fields/related.py in __set__, line 337
  Python Executable:  /home/mikhail/virtualenv/test/bin/python3.3
  Python Version: 3.3.5
  Python Path:    
  ['/home/mikhail/virtualenv/test/bin/mysite',
   '/home/mikhail/virtualenv/test/lib/python3.3/site-packages/MySQL_python-1.2.3-py3.3-linux-x86_64.egg',
   '/home/mikhail/virtualenv/test/lib/python3.3',
   '/home/mikhail/virtualenv/test/lib/python3.3/plat-linux',
   '/home/mikhail/virtualenv/test/lib/python3.3/lib-dynload',
   '/usr/lib/python3.3',
   '/usr/lib/python3.3/plat-linux',
   '/home/mikhail/virtualenv/test/lib/python3.3/site-p
  </code></pre>
  
  <p><strong>problem in the serializer or view?
  How to fix?</strong></p>