diff options
| author | Tom Christie | 2014-08-29 11:09:35 +0100 | 
|---|---|---|
| committer | Tom Christie | 2014-08-29 11:09:35 +0100 | 
| commit | b3bbf416707cf8c71861b0fd6e966a557acef412 (patch) | |
| tree | aff4602985a7d8e86dc51a10daa72dabb15fd340 /rest_framework/mixins.py | |
| parent | 0f8fdf4e72b67ff46474c13c8b532bf319a58099 (diff) | |
| download | django-rest-framework-b3bbf416707cf8c71861b0fd6e966a557acef412.tar.bz2 | |
Remove `allow_empty`
Diffstat (limited to 'rest_framework/mixins.py')
| -rw-r--r-- | rest_framework/mixins.py | 15 | 
1 files changed, 0 insertions, 15 deletions
| diff --git a/rest_framework/mixins.py b/rest_framework/mixins.py index 2cc87eef..dc4c9f35 100644 --- a/rest_framework/mixins.py +++ b/rest_framework/mixins.py @@ -70,24 +70,9 @@ class ListModelMixin(object):      """      List a queryset.      """ -    empty_error = "Empty list and '%(class_name)s.allow_empty' is False." -      def list(self, request, *args, **kwargs):          self.object_list = self.filter_queryset(self.get_queryset()) -        # Default is to allow empty querysets.  This can be altered by setting -        # `.allow_empty = False`, to raise 404 errors on empty querysets. -        if not self.allow_empty and not self.object_list: -            warnings.warn( -                'The `allow_empty` parameter is deprecated. ' -                'To use `allow_empty=False` style behavior, You should override ' -                '`get_queryset()` and explicitly raise a 404 on empty querysets.', -                DeprecationWarning -            ) -            class_name = self.__class__.__name__ -            error_msg = self.empty_error % {'class_name': class_name} -            raise Http404(error_msg) -          # Switch between paginated or standard style responses          page = self.paginate_queryset(self.object_list)          if page is not None: | 
