users package¶
Subpackages¶
Submodules¶
users.admin module¶
users.apps module¶
users.middleware module¶
-
class
users.middleware.
GetTokenMiddleware
(get_response)¶ Bases:
object
Middleware used to get the token from HTTP headers
users.models module¶
-
users.models.
create_auth_token
(sender, instance=None, created=False, **kwargs)¶ Create token for user
-
users.models.
reset_auth_token
(instance)¶ Method to assign a new token to a user
users.serializers module¶
-
class
users.serializers.
GroupSerializer
(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)¶ Bases:
rest_framework.serializers.ModelSerializer
Serializer to map the Model instance into JSON format.
-
class
users.serializers.
LoginUserSerializer
(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)¶ Bases:
rest_framework.serializers.ModelSerializer
Serializer to map the Model instance into JSON format.
-
class
users.serializers.
UserSerializer
(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)¶ Bases:
rest_framework.serializers.ModelSerializer
Serializer to map the Model instance into JSON format.
users.urls module¶
users.views module¶
-
class
users.views.
LoggedObtainAuthToken
(**kwargs)¶ Bases:
rest_framework.authtoken.views.ObtainAuthToken
API endpoint to obtain authorization tokens
-
post
(request, *args, **kwargs)¶ Handle post requests
-
-
class
users.views.
UserViewSet
(**kwargs)¶ Bases:
rest_framework.viewsets.ModelViewSet
List, Create, Retrieve, Update and Destroy Users.
-
allowed_actions
(request, pk=None)¶ Returns a dictionary with users permissions: ack, shelve, unshelve
-
basename
= None¶
-
can_ack
(request, pk=None)¶ Check if the user has acknowledge permissions
-
can_shelve
(request, pk=None)¶ Check if the user has shelve permissions
-
can_unshelve
(request, pk=None)¶ Check if the user has unshelve permissions
-
detail
= None¶
-
filter
(request)¶ Retrieve the list of users filtered by group
-
get_permissions
()¶ Instantiates and returns the list of permissions that the view requires
-
queryset
= <QuerySet [<User: admin>, <User: operator_on_duty>, <User: timer>]>¶
-
serializer_class
¶ alias of
users.serializers.UserSerializer
-
suffix
= None¶
-
validate_token
(request)¶ Validates the token and returns 2 dictionaries: user data and users permissions (ack, shelve, unshelve)
-