-
-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from hishnash/bump/v0.3.0
Bump version and run black formating
- Loading branch information
Showing
9 changed files
with
58 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.2.2" | ||
__version__ = "0.3.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,8 +34,8 @@ def create(self, data: dict, **kwargs) -> Tuple[ReturnDict, int]: | |
class LiveConsumer(CreateModelMixin, GenericAsyncAPIConsumer): | ||
queryset = User.objects.all() | ||
serializer_class = UserSerializer | ||
permission_classes = (permissions.AllowAny,) | ||
permission_classes = (permissions.AllowAny,) | ||
.. code-block:: python | ||
#! routing.py | ||
|
@@ -67,7 +67,7 @@ class LiveConsumer(CreateModelMixin, GenericAsyncAPIConsumer): | |
"request_id": 150060530, | ||
"data": {'username': 'test', 'id': 42,}, | ||
} | ||
*/ | ||
*/ | ||
""" | ||
|
||
serializer = self.get_serializer(data=data, action_kwargs=kwargs) | ||
|
@@ -81,7 +81,7 @@ def perform_create(self, serializer, **kwargs): | |
|
||
class ListModelMixin: | ||
"""List model mixin""" | ||
|
||
@action() | ||
def list(self, **kwargs) -> Tuple[ReturnList, int]: | ||
"""List action. | ||
|
@@ -102,8 +102,8 @@ def list(self, **kwargs) -> Tuple[ReturnList, int]: | |
class LiveConsumer(ListModelMixin, GenericAsyncAPIConsumer): | ||
queryset = User.objects.all() | ||
serializer_class = UserSerializer | ||
permission_classes = (permissions.AllowAny,) | ||
permission_classes = (permissions.AllowAny,) | ||
.. code-block:: python | ||
#! routing.py | ||
|
@@ -133,7 +133,7 @@ class LiveConsumer(ListModelMixin, GenericAsyncAPIConsumer): | |
{"email": "[email protected]", "id": 2, "username": "test2"}, | ||
], | ||
} | ||
*/ | ||
*/ | ||
""" | ||
queryset = self.filter_queryset(self.get_queryset(**kwargs), **kwargs) | ||
serializer = self.get_serializer( | ||
|
@@ -144,7 +144,7 @@ class LiveConsumer(ListModelMixin, GenericAsyncAPIConsumer): | |
|
||
class RetrieveModelMixin: | ||
"""Retrieve model mixin""" | ||
|
||
@action() | ||
def retrieve(self, **kwargs) -> Tuple[ReturnDict, int]: | ||
"""Retrieve action. | ||
|
@@ -165,8 +165,8 @@ def retrieve(self, **kwargs) -> Tuple[ReturnDict, int]: | |
class LiveConsumer(RetrieveModelMixin, GenericAsyncAPIConsumer): | ||
queryset = User.objects.all() | ||
serializer_class = UserSerializer | ||
permission_classes = (permissions.AllowAny,) | ||
permission_classes = (permissions.AllowAny,) | ||
.. code-block:: python | ||
#! routing.py | ||
|
@@ -194,7 +194,7 @@ class LiveConsumer(RetrieveModelMixin, GenericAsyncAPIConsumer): | |
"request_id": 1500000, | ||
"data": {"email": "[email protected]", "id": 1, "username": "test1"}, | ||
} | ||
*/ | ||
*/ | ||
""" | ||
instance = self.get_object(**kwargs) | ||
serializer = self.get_serializer(instance=instance, action_kwargs=kwargs) | ||
|
@@ -224,8 +224,8 @@ def update(self, data: dict, **kwargs) -> Tuple[ReturnDict, int]: | |
class LiveConsumer(UpdateModelMixin, GenericAsyncAPIConsumer): | ||
queryset = User.objects.all() | ||
serializer_class = UserSerializer | ||
permission_classes = (permissions.AllowAny,) | ||
permission_classes = (permissions.AllowAny,) | ||
.. code-block:: python | ||
#! routing.py | ||
|
@@ -256,7 +256,7 @@ class LiveConsumer(UpdateModelMixin, GenericAsyncAPIConsumer): | |
"request_id": 1500000, | ||
"data": {"email": "[email protected]", "id": 1, "username": "test edited"}, | ||
} | ||
*/ | ||
*/ | ||
""" | ||
instance = self.get_object(data=data, **kwargs) | ||
|
||
|
@@ -301,8 +301,8 @@ def patch(self, data: dict, **kwargs) -> Tuple[ReturnDict, int]: | |
class LiveConsumer(PatchModelMixin, GenericAsyncAPIConsumer): | ||
queryset = User.objects.all() | ||
serializer_class = UserSerializer | ||
permission_classes = (permissions.AllowAny,) | ||
permission_classes = (permissions.AllowAny,) | ||
.. code-block:: python | ||
#! routing.py | ||
|
@@ -333,7 +333,7 @@ class LiveConsumer(PatchModelMixin, GenericAsyncAPIConsumer): | |
"request_id": 150000, | ||
"data": {"email": "[email protected]", "id": 1, "username": "test1"}, | ||
} | ||
*/ | ||
*/ | ||
""" | ||
instance = self.get_object(data=data, **kwargs) | ||
|
||
|
@@ -378,8 +378,8 @@ def delete(self, **kwargs) -> Tuple[None, int]: | |
class LiveConsumer(DeleteModelMixin, GenericAsyncAPIConsumer): | ||
queryset = User.objects.all() | ||
serializer_class = UserSerializer | ||
permission_classes = (permissions.AllowAny,) | ||
permission_classes = (permissions.AllowAny,) | ||
.. code-block:: python | ||
#! routing.py | ||
|
@@ -407,7 +407,7 @@ class LiveConsumer(DeleteModelMixin, GenericAsyncAPIConsumer): | |
"request_id": 150000, | ||
"data": null, | ||
} | ||
*/ | ||
*/ | ||
""" | ||
instance = self.get_object(**kwargs) | ||
|
||
|
@@ -451,9 +451,7 @@ def paginator(self) -> Optional[any]: | |
self._paginator = self.pagination_class() | ||
return self._paginator | ||
|
||
def paginate_queryset( | ||
self, queryset, **kwargs: Dict | ||
) -> Optional[Any]: | ||
def paginate_queryset(self, queryset, **kwargs: Dict) -> Optional[Any]: | ||
if self.paginator is None: | ||
return None | ||
return self.paginator.paginate_queryset( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
setup( | ||
name="djangochannelsrestframework", | ||
version="0.2.2", | ||
version="0.3.0", | ||
url="https://github.com/hishnash/djangochannelsrestframework", | ||
author="Matthaus Woolard", | ||
author_email="[email protected]", | ||
|