title: Django Rest Framework: Access item detail by slug instead of ID
body: <p>Is it possible to use a object's slug (or any other field) to access the details of an item, instead of using the ID?</p>
  
  <p>For example, if I have an item with the slug "lorem" and ID 1. By default the URL is <code>http://localhost:9999/items/1/</code>. I want to access it via <code>http://localhost:9999/items/lorem/</code> instead.</p>
  
  <p>Adding <code>lookup_field</code> in the serializer's Meta class did nothing to change the automatically generated URL nor did it allow me to access the item by manually writing the slug instead of the ID in the URL.</p>
  
  <p>models.py</p>
  
  <pre><code>class Item(models.Model):
      slug = models.CharField(max_length=100, unique=True)
      title = models.CharField(max_length=100, blank=True, default='')
      # An arbitrary, user provided, URL
      item_url = models.URLField(unique=True)
  </code></pre>
  
  <p>serializers.py</p>
  
  <pre><code>class ClassItemSerializer(serializers.HyperlinkedModelSerializer):
       class Meta:
          model = Item
          fields = ('url', 'slug', 'title', 'item_url')
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>class ItemViewSet(viewsets.ModelViewSet):
      queryset = Item.objects.all()
      serializer_class = ItemSerializer
  </code></pre>
  
  <p>urls.py</p>
  
  <pre><code>router = DefaultRouter()
  router.register(r'items', views.ItemViewSet)
  
  urlpatterns = [
      url(r'^', include(router.urls)),
  ]
  </code></pre>
  
  <p>Generated JSON:</p>
  
  <pre><code>[
      {
          "url": "http://localhost:9999/items/1/",
          "slug": "lorem",
          "title": "Lorem",
          "item_url": "http://example.com"
      }
  ]
  </code></pre>