@@ -45,7 +45,7 @@ def __init__(self, *args, **kwargs):
45
45
self .model_class = kwargs .pop ("model_class" , self .model_class )
46
46
# this has no fields but assumptions are made elsewhere that self.fields exists.
47
47
self .fields = {}
48
- super (ResourceIdentifierObjectSerializer , self ).__init__ (* args , ** kwargs )
48
+ super ().__init__ (* args , ** kwargs )
49
49
50
50
def to_representation (self , instance ):
51
51
return {
@@ -69,15 +69,15 @@ def to_internal_value(self, data):
69
69
self .fail ("incorrect_type" , data_type = type (data ["pk" ]).__name__ )
70
70
71
71
72
- class SparseFieldsetsMixin ( object ) :
72
+ class SparseFieldsetsMixin :
73
73
"""
74
74
A serializer mixin that adds support for sparse fieldsets through `fields` query parameter.
75
75
76
76
Specification: https://jsonapi.org/format/#fetching-sparse-fieldsets
77
77
"""
78
78
79
79
def __init__ (self , * args , ** kwargs ):
80
- super (SparseFieldsetsMixin , self ).__init__ (* args , ** kwargs )
80
+ super ().__init__ (* args , ** kwargs )
81
81
context = kwargs .get ("context" )
82
82
request = context .get ("request" ) if context else None
83
83
@@ -107,7 +107,7 @@ def __init__(self, *args, **kwargs):
107
107
self .fields .pop (field_name )
108
108
109
109
110
- class IncludedResourcesValidationMixin ( object ) :
110
+ class IncludedResourcesValidationMixin :
111
111
"""
112
112
A serializer mixin that adds validation of `include` query parameter to
113
113
support compound documents.
@@ -150,7 +150,7 @@ def validate_path(serializer_class, field_path, path):
150
150
this_serializer_class , included_field_path , included_field_name
151
151
)
152
152
153
- super (IncludedResourcesValidationMixin , self ).__init__ (* args , ** kwargs )
153
+ super ().__init__ (* args , ** kwargs )
154
154
155
155
156
156
class LazySerializersDict (Mapping ):
@@ -302,9 +302,7 @@ class PolymorphicSerializerMetaclass(SerializerMetaclass):
302
302
"""
303
303
304
304
def __new__ (cls , name , bases , attrs ):
305
- new_class = super (PolymorphicSerializerMetaclass , cls ).__new__ (
306
- cls , name , bases , attrs
307
- )
305
+ new_class = super ().__new__ (cls , name , bases , attrs )
308
306
309
307
# Ensure initialization is only performed for subclasses of PolymorphicModelSerializer
310
308
# (excluding PolymorphicModelSerializer class itself).
@@ -363,7 +361,7 @@ def get_fields(self):
363
361
raise Exception (
364
362
"Cannot get fields from a polymorphic serializer given a queryset"
365
363
)
366
- return super (PolymorphicModelSerializer , self ).get_fields ()
364
+ return super ().get_fields ()
367
365
368
366
@classmethod
369
367
def get_polymorphic_serializer_for_instance (cls , instance ):
0 commit comments