mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
Add User import. Refs #599
This commit is contained in:
parent
128bda5712
commit
075b8c1037
|
@ -67,6 +67,9 @@ Because `'snippets'` is a *reverse* relationship on the User model, it will not
|
|||
|
||||
We'll also add a couple of views to `views.py`. We'd like to just use read-only views for the user representations, so we'll use the `ListAPIView` and `RetrieveAPIView` generic class based views.
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
|
||||
class UserList(generics.ListAPIView):
|
||||
queryset = User.objects.all()
|
||||
serializer_class = UserSerializer
|
||||
|
|
Loading…
Reference in New Issue
Block a user