Extending extra action mapping

65 views
Skip to first unread message

Kamil Talipov

unread,
Aug 24, 2021, 5:20:28 AM8/24/21
to Django REST framework
Hi, 
im trying use same url on 2 actions, but with different parses.
in second function @action will be ignored, and have not effect, it uses @action from first function
exist way to around it? 

example:
@action(methods=['post'], detail=False, parser_classes = (MultiPartParser,), url_path = r"(?P<group_id>\d+)/users")
def append_from_file(self,req,group_id:int):
    ...

@append_from_file.mapping.delete
@action(methods=['delete'], detail=False, parser_classes = (JSONParser,), url_path = r"(?P<group_id>\d+)/users")
def delete_use_list(self,req,group_id:int):
    ...


Reply all
Reply to author
Forward
0 new messages