We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cf8a930 + d3d3114 commit 33ded1cCopy full SHA for 33ded1c
rest_framework_json_api/serializers.py
@@ -13,8 +13,10 @@ class ResourceIdentifierObjectSerializer(BaseSerializer):
13
'incorrect_type': _('Incorrect type. Expected pk value, received {data_type}.'),
14
}
15
16
+ model_class = None
17
+
18
def __init__(self, *args, **kwargs):
- self.model_class = kwargs.pop('model_class', None)
19
+ self.model_class = kwargs.pop('model_class', self.model_class)
20
if 'instance' not in kwargs and not self.model_class:
21
raise RuntimeError('ResourceIdentifierObjectsSerializer must be initialized with a model class.')
22
super(ResourceIdentifierObjectSerializer, self).__init__(*args, **kwargs)
0 commit comments