mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
Re-add implementation of multiple-operation generic views to remove diamond inheritance
This commit is contained in:
parent
16e249d60d
commit
d6e10b50fc
|
@ -144,23 +144,44 @@ class UpdateAPIView(mixins.UpdateModelMixin,
|
||||||
return self.update(request, *args, **kwargs)
|
return self.update(request, *args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class ListCreateAPIView(ListAPIView,
|
class ListCreateAPIView(mixins.ListModelMixin,
|
||||||
CreateAPIView):
|
mixins.CreateModelMixin,
|
||||||
|
MultipleObjectBaseView):
|
||||||
"""
|
"""
|
||||||
Concrete view for listing a queryset or creating a model instance.
|
Concrete view for listing a queryset or creating a model instance.
|
||||||
"""
|
"""
|
||||||
|
def get(self, request, *args, **kwargs):
|
||||||
|
return self.list(request, *args, **kwargs)
|
||||||
|
|
||||||
|
def post(self, request, *args, **kwargs):
|
||||||
|
return self.create(request, *args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class RetrieveDestroyAPIView(RetrieveAPIView,
|
class RetrieveDestroyAPIView(mixins.RetrieveModelMixin,
|
||||||
DestroyAPIView):
|
mixins.DestroyModelMixin,
|
||||||
|
SingleObjectBaseView):
|
||||||
"""
|
"""
|
||||||
Concrete view for retrieving or deleting a model instance.
|
Concrete view for retrieving or deleting a model instance.
|
||||||
"""
|
"""
|
||||||
|
def get(self, request, *args, **kwargs):
|
||||||
|
return self.retrieve(request, *args, **kwargs)
|
||||||
|
|
||||||
|
def delete(self, request, *args, **kwargs):
|
||||||
|
return self.destroy(request, *args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class RetrieveUpdateDestroyAPIView(RetrieveAPIView,
|
class RetrieveUpdateDestroyAPIView(mixins.RetrieveModelMixin,
|
||||||
UpdateAPIView,
|
mixins.UpdateModelMixin,
|
||||||
DestroyAPIView):
|
mixins.DestroyModelMixin,
|
||||||
|
SingleObjectBaseView):
|
||||||
"""
|
"""
|
||||||
Concrete view for retrieving, updating or deleting a model instance.
|
Concrete view for retrieving, updating or deleting a model instance.
|
||||||
"""
|
"""
|
||||||
|
def get(self, request, *args, **kwargs):
|
||||||
|
return self.retrieve(request, *args, **kwargs)
|
||||||
|
|
||||||
|
def put(self, request, *args, **kwargs):
|
||||||
|
return self.update(request, *args, **kwargs)
|
||||||
|
|
||||||
|
def delete(self, request, *args, **kwargs):
|
||||||
|
return self.destroy(request, *args, **kwargs)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user