Removing Partial Update classes

PATCH methods merged into RetrieveUpdateDestroy class
This commit is contained in:
Andrew Hankinson 2012-12-30 13:56:59 -04:00
parent e61eab43f4
commit b9e48e8413

View File

@ -171,13 +171,6 @@ class UpdateAPIView(mixins.UpdateModelMixin,
def put(self, request, *args, **kwargs):
return self.update(request, partial=False, *args, **kwargs)
class ParitalUpdateAPIView(mixins.UpdateModelMixin,
SingleObjectAPIView):
"""
Concrete view for paritally updating a model instance.
"""
def patch(self, request, *args, **kwargs):
return self.update(request, partial=True, *args, **kwargs)
@ -224,24 +217,5 @@ class RetrieveUpdateDestroyAPIView(mixins.RetrieveModelMixin,
def delete(self, request, *args, **kwargs):
return self.destroy(request, *args, **kwargs)
class RetrievePartialUpdateDestroyAPIView(mixins.RetrieveModelMixin,
mixins.UpdateModelMixin,
mixins.DestroyModelMixin,
SingleObjectAPIView):
"""
Concrete view for retrieving, updating via PATCH (partial) or PUT (full),
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, partial=False, *args, **kwargs)
def patch(self, request, *args, **kwargs):
return self.update(request, partial=True, *args, **kwargs)
def delete(self, request, *args, **kwargs):
return self.destroy(request, *args, **kwargs)