-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple detail_route for the same url_path #2708
Comments
This is a usage question that you should really post on the mailing list... Nonetheless, override |
Forgetting for a moment even wanting to have different permission classes, why is this not supported (and I don't think this is a usage question): @detail_route(methods=['post'], url_path='users')
def users_create(self, request, **kwargs):
data = request.data
serializer = UserSerializer(data=data)
serializer.is_valid(raise_exception=True)
user = serializer.validated_data
return Response(serializer.data, status=status.HTTP_201_CREATED)
@detail_route(methods=['get'], url_path='users')
def users_list(self, request, **kwargs):
serializer = UserSerializer(data=[], many=True)
serializer.is_valid(raise_exception=True)
return Response(serializer.data, status=status.HTTP_200_OK) |
@cancan101 that request seems similar to what #2820 is trying to accomplish. |
I would like to have multiple
detail_route
for the sameurl_path
but with different HTTP methods. I would like to do this so that I may specify differentpermission_classes
.Unfortunately this does not seem to work in the browseable API:
The text was updated successfully, but these errors were encountered: