Api_view['POST', 'GET'] against SOLID principles?
It's not a problem I'm facing its just an open discussion. in Django Rest framework we declare a decorator @api_view[] and it take an argument like
- POST
- GET
- PUT
- DELETE
in my case I'm allowed to put more than one argument in the decorator and make one function made more than one responsibility like
@api_view['POST', 'GET]
def fbv_list(request):`
if request.method == 'POST':
#do something
if request.method == 'GET':
#do something
in this case fbv_list make more than one thing which is POST and GET isn't in this case this function is against the Single responsibility class which is from SOLID principles ????
That's my question and if yes what is supposed to do to avoid breaking the SOLID .
Thanks in advance.