Created
July 15, 2014 17:49
-
-
Save macndesign/9e87565789628504e476 to your computer and use it in GitHub Desktop.
drf serializer test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.auth.models import User, Group | |
from rest_framework import serializers | |
class UserSerializer(serializers.HyperlinkedModelSerializer): | |
class Meta: | |
model = User | |
fields = ('url', 'username', 'email', 'groups') | |
class GroupSerializer(serializers.HyperlinkedModelSerializer): | |
class Meta: | |
model = Group | |
fields = ('url', 'name') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment