title: django rest framework create for self.request.user.<model>
body: <p>I have <code>Folder</code> model. <code>Folder</code> has <code>foreignkey</code> to <code>User</code> called <code>folders</code>.</p>
  
  <p>In django rest framework I would like to create new <code>Folder</code> object. How do I specify "create object at self.request.user.folders"? under current (out of the box vanilla <code>ModelViewSet</code>) implementation I get error:</p>
  
  <blockquote>
    <p>folder.folder.user_id may not be NULL</p>
  </blockquote>
  
  <p>This indicates that a we are trying to create <code>Folder</code> object is without specifying a <code>user</code>.</p>
  
  <p>Is there a built in way or will I need to override the <code>create</code> method and pass <code>user</code> in to the serializer as a argument?</p>
  
  <p>Note that we don't want to pass <code>user_id</code> in <code>request.DATA</code> due to security issues.</p>
  
  <p>models.py:</p>
  
  <pre><code>class FolderModel(Model):
      user = ForeignKey(User, related_name='folders')
      title = CharField(max_length=100)
  </code></pre>
  
  <p>views.py:</p>
  
  <pre><code>class FolderView(viewsets.ModelViewSet):
      serializer_class = serializers.FoldereSerializer
      model = FolderModel
  
      def get_queryset(self):
          return self.request.user.folders.all()
  </code></pre>