From 7109b5738325f63493c0029ca822bc6560fcd0fd Mon Sep 17 00:00:00 2001 From: Brett Jones Date: Mon, 28 Apr 2014 12:06:34 -0400 Subject: [PATCH] Updated the simple example on the main page to include a UserSerializer object. The example code will compile and run without errors. This 'fixes' issue #1249 by providing example code that doesn't cause the error. --- docs/index.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 2a4ad8859..43fbe4075 100644 --- a/docs/index.md +++ b/docs/index.md @@ -120,7 +120,13 @@ Here's our project's root `urls.py` module: from django.conf.urls import url, patterns, include from django.contrib.auth.models import User, Group - from rest_framework import viewsets, routers + from rest_framework import viewsets, routers, serializers + + # When implemented, Serializers customize how and what data is managed + class UserSerializer(serializers.HyperlinkedModelSerializer): + class Meta: + # Specify which fields to expose in the API + fields = ('username', 'email',) # ViewSets define the view behavior. class UserViewSet(viewsets.ModelViewSet):