title: django rest framework Serialization of foreign key
body: <p>I just started to learn <strong>django rest framework</strong> and the following are files of my Topic app</p>
  
  <p>======models.py=====</p>
  
  <pre><code>from django.contrib.auth.models import User
  class Topic(models.Model):
      title = models.CharField(max_length=100,verbose_name="Topic Title")
      description = models.CharField(max_length=500, verbose_name="Topic Description")
      user = models.ForeignKey(to=User,related_name="user_topics")
  </code></pre>
  
  <p>=====serializers.py=====</p>
  
  <pre><code>class TopicSerializer(ModelSerializer):
      class Meta:
          model = Topic
          fields = "__all__"
  </code></pre>
  
  <p>=====views.py=====</p>
  
  <pre><code>class TopicViewSet(ModelViewSet):
      queryset = Topic.objects.all()
      serializer_class = TopicSerializer
  </code></pre>
  
  <p>I'am able to create a "Topic" data using httpie as follows</p>
  
  <pre><code>http POST http://127.0.0.1:8989/api/v1/topics/ description="Learn Python" title="Python" user=1
  </code></pre>
  
  <p><strong>NOW</strong> my need is that the topic detail should have the "user" key expanded for the User - (<strong><em>While maintaining the same  "user" key</em></strong> to PASS user id to create a topic) ie.,</p>
  
  <p>making a GET request to the detail should return the following</p>
  
  <pre><code>http GET http://127.0.0.1:8989/api/v1/topics/1/
  =====
  HTTP/1.0 200 OK
  
  {
      "description": "Learn Python", 
      "id": 1, 
      "title": "Python", 
      "user": { name:"blah blah"
          ...
          ...
       }      
  }
  </code></pre>
  
  <p><strong>AND</strong> </p>
  
  <p>Making a post with user id in "user" key should create the "Topic" and should return the response with user expanded in "user" key ie.,</p>
  
  <pre><code>http POST http://127.0.0.1:8989/api/v1/topics/ description="Learn Python" title="Python" user=1
  HTTP/1.0 201 Created
  ....
  
  {
      "description": "Learn Python", 
      "id": 1, 
      "title": "Python", 
      "user": { name:"blah blah", ...}
  }
  </code></pre>
  
  <p><strong><em>What changes do i need to make</em></strong>, so that i will be able to use the <strong>SAME</strong> "user" key? for 3 following purpose</p>
  
  <ol>
  <li>to make a POST with "user id" to create a Topic // user:1</li>
  <li>The <strong>POST response returned while creating a Topic</strong> should have the user expanded in user key //user : { name:"blah blah", ...}</li>
  <li>Also, to GET the detail expanded // user : { name:"blah blah", ...}</li>
  </ol>
  
  <p>or 
  <strong><em>please suggest an better way of doing this</em></strong>.</p>