mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-22 02:18:21 +02:00
Reformat code, add some missing lines at end of files
This commit is contained in:
@ -10,15 +10,18 @@ from .activity.urls import register_activity_urls
|
||||
from .members.urls import register_members_urls
|
||||
from .note.urls import register_note_urls
|
||||
|
||||
|
||||
class UserSerializer(serializers.ModelSerializer):
|
||||
"""
|
||||
REST API Serializer for Users.
|
||||
The djangorestframework plugin will analyse the model `User` and parse all fields in the API.
|
||||
"""
|
||||
|
||||
class Meta:
|
||||
model = User
|
||||
exclude = ('password', 'groups', 'user_permissions',)
|
||||
|
||||
|
||||
class UserViewSet(viewsets.ModelViewSet):
|
||||
"""
|
||||
REST API View set.
|
||||
@ -28,6 +31,7 @@ class UserViewSet(viewsets.ModelViewSet):
|
||||
queryset = User.objects.all()
|
||||
serializer_class = UserSerializer
|
||||
|
||||
|
||||
# Routers provide an easy way of automatically determining the URL conf.
|
||||
router = routers.DefaultRouter()
|
||||
router.register('user', UserViewSet)
|
||||
@ -46,4 +50,4 @@ register_note_urls(router, 'note')
|
||||
urlpatterns = [
|
||||
url('^', include(router.urls)),
|
||||
url('^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
|
||||
]
|
||||
]
|
||||
|
Reference in New Issue
Block a user