mirror of
https://github.com/inventree/InvenTree.git
synced 2025-10-24 18:07:38 +00:00
generalize addition
This commit is contained in:
@@ -53,6 +53,14 @@ class PathScopedMixin:
|
|||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
"""Initialization routine for the serializer."""
|
"""Initialization routine for the serializer."""
|
||||||
|
# add list_serializer_class to meta if not present
|
||||||
|
if (
|
||||||
|
not isinstance(self, FilterableListSerializer)
|
||||||
|
and (not hasattr(self.Meta, 'list_serializer_class'))
|
||||||
|
and issubclass(self.__class__, serializers.ListSerializer)
|
||||||
|
):
|
||||||
|
self.Meta.list_serializer_class = FilterableListSerializer
|
||||||
|
|
||||||
self.gather_filters(kwargs)
|
self.gather_filters(kwargs)
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
self.do_filtering(*args, **kwargs)
|
self.do_filtering(*args, **kwargs)
|
||||||
|
|||||||
Reference in New Issue
Block a user