Commit 075b8c10 by Tom Christie

Add User import. Refs #599

parent 128bda57
...@@ -67,6 +67,9 @@ Because `'snippets'` is a *reverse* relationship on the User model, it will not ...@@ -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. 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): class UserList(generics.ListAPIView):
queryset = User.objects.all() queryset = User.objects.all()
serializer_class = UserSerializer serializer_class = UserSerializer
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment