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.

This commit is contained in:
Brett Jones 2014-04-28 12:06:34 -04:00
parent f4a82dd5da
commit 7109b57383

View File

@ -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):