@@ -30,14 +30,15 @@ def __init__(self, kwargs):
30
30
31
31
:param dict kwargs: information about data layer instance
32
32
"""
33
+ if kwargs .get ('methods' ) is not None :
34
+ self .bound_additional_methods (kwargs ['methods' ])
35
+ kwargs .pop ('methods' )
36
+
33
37
kwargs .pop ('class' , None )
34
38
35
39
for key , value in kwargs .items ():
36
40
setattr (self , key , value )
37
41
38
- if kwargs .get ('methods' ) is not None :
39
- self .bound_additional_methods ()
40
-
41
42
def create_object (self , data , view_kwargs ):
42
43
"""Create an object
43
44
@@ -310,10 +311,11 @@ def after_delete_relationship(self, obj, updated, json_data, relationship_field,
310
311
"""
311
312
raise NotImplementedError
312
313
313
- def bound_additional_methods (self ):
314
+ def bound_additional_methods (self , methods ):
314
315
"""Bound additional methods to current instance
315
316
316
317
:param class meta: information from Meta class used to configure the data layer instance
317
318
"""
318
- for key , value in self .methods .items ():
319
- setattr (self , key , types .MethodType (value , self ))
319
+ for key , value in methods .items ():
320
+ if key in self .ADDITIONAL_METHODS :
321
+ setattr (self , key , types .MethodType (value , self ))
0 commit comments