mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 12:30:11 +03:00
Merge cc5741072e
into 5333a93126
This commit is contained in:
commit
2ddb5e36f1
|
@ -120,7 +120,13 @@ Here's our project's root `urls.py` module:
|
||||||
|
|
||||||
from django.conf.urls import url, patterns, include
|
from django.conf.urls import url, patterns, include
|
||||||
from django.contrib.auth.models import User, Group
|
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.
|
# ViewSets define the view behavior.
|
||||||
class UserViewSet(viewsets.ModelViewSet):
|
class UserViewSet(viewsets.ModelViewSet):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user