title: Django rest framework nested self-referential objects
body: <p>I have model that looks like this:</p>
  
  <pre><code>class Category(models.Model):
      parentCategory = models.ForeignKey('self', blank=True, null=True, related_name='subcategories')
      name = models.CharField(max_length=200)
      description = models.CharField(max_length=500)
  </code></pre>
  
  <p>I managed to get flat json representation of all categories with serializer:</p>
  
  <pre><code>class CategorySerializer(serializers.HyperlinkedModelSerializer):
      parentCategory = serializers.PrimaryKeyRelatedField()
      subcategories = serializers.ManyRelatedField()
  
      class Meta:
          model = Category
          fields = ('parentCategory', 'name', 'description', 'subcategories')
  </code></pre>
  
  <p>Now what I want to do is for subcategories list to have inline json representation of subcategories instead of their ids. How would I do that with django-rest-framework? I tried to find it in documentation, but it seems incomplete.</p>