Skip to content

Commit

Permalink
Specify __all__ in mixins and generics
Browse files Browse the repository at this point in the history
This fixes #2 by specifically saying what will be imported from
`mixins.py` and `generics.py` when a star import is done on these
files.  This is done within `__init__.py`, so the classes can be
imported directly from there.  This prevents an issue where
`rest_framework.mixins` was being imported from `generics.py`, so
users were not able to import `rest_bulk_create.mixins`.
  • Loading branch information
Kevin Brown committed Apr 4, 2014
1 parent 701734a commit aecad13
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,5 @@ Credits

Current maintainers:

* Miroslav Shubernetskiy - `GitHub <https://github.com/miki725>`_.

* Miroslav Shubernetskiy - `GitHub <https://github.com/miki725>`_
* Kevin Brown - `GitHub <https://github.com/kevin-brown>`_
5 changes: 5 additions & 0 deletions rest_framework_bulk/generics.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
from . import mixins as bulk_mixins


__all__ = ["BulkCreateAPIView", "BulkUpdateAPIView", "BulkDestroyAPIView", "ListBulkCreateAPIView",
"ListCreateBulkUpdateAPIView", "ListCreateBulkUpdateDestroyAPIView", "ListBulkCreateUpdateAPIView",
"ListBulkCreateUpdateDestroyAPIView"]


##########################################################
### Concrete view classes that provide method handlers ###
### by composing the mixin classes with the base view. ###
Expand Down
3 changes: 3 additions & 0 deletions rest_framework_bulk/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
from rest_framework.response import Response


__all__ = ["BulkCreateModelMixin", "BulkUpdateModelMixin", "BulkDestroyModelMixin"]


class BulkCreateModelMixin(CreateModelMixin):
"""
Either create a single or many model instances in bulk by using the
Expand Down

0 comments on commit aecad13

Please sign in to comment.