diff options
| author | Xavier Ordoquy | 2013-01-02 16:09:21 +0100 | 
|---|---|---|
| committer | Xavier Ordoquy | 2013-01-02 16:09:21 +0100 | 
| commit | 737349d2389197d23886b72c1cb44f53c501ac9a (patch) | |
| tree | 0c542b6c73deee0280705c8253334126c5f5d254 /rest_framework/mixins.py | |
| parent | 5fad46d7e213afed503b1533515cab96875a5936 (diff) | |
| parent | d379997aba5b1e41309bbed8740ed704c0feb58b (diff) | |
| download | django-rest-framework-737349d2389197d23886b72c1cb44f53c501ac9a.tar.bz2 | |
Merge remote-tracking branch 'reference/py3k' into p3k
Diffstat (limited to 'rest_framework/mixins.py')
| -rw-r--r-- | rest_framework/mixins.py | 8 | 
1 files changed, 6 insertions, 2 deletions
| diff --git a/rest_framework/mixins.py b/rest_framework/mixins.py index 87d97bed..503376ce 100644 --- a/rest_framework/mixins.py +++ b/rest_framework/mixins.py @@ -115,6 +115,10 @@ class UpdateModelMixin(object):              slug_field = self.get_slug_field()              setattr(obj, slug_field, slug) +        # Ensure we clean the attributes so that we don't eg return integer +        # pk using a string representation, as provided by the url conf kwarg. +        obj.full_clean() +  class DestroyModelMixin(object):      """ @@ -122,6 +126,6 @@ class DestroyModelMixin(object):      Should be mixed in with `SingleObjectBaseView`.      """      def destroy(self, request, *args, **kwargs): -        self.object = self.get_object() -        self.object.delete() +        obj = self.get_object() +        obj.delete()          return Response(status=status.HTTP_204_NO_CONTENT) | 
