@@ -57,13 +57,13 @@ class PolymorphicModelBase(ModelBase):
57
57
PolymorphicQuerySet.
58
58
"""
59
59
60
- def __new__ (self , model_name , bases , attrs ):
60
+ def __new__ (self , model_name , bases , attrs , ** kwargs ):
61
61
# print; print '###', model_name, '- bases:', bases
62
62
63
63
# Workaround compatibility issue with six.with_metaclass() and custom Django model metaclasses:
64
64
if not attrs and model_name == "NewBase" :
65
65
return super (PolymorphicModelBase , self ).__new__ (
66
- self , model_name , bases , attrs
66
+ self , model_name , bases , attrs , ** kwargs
67
67
)
68
68
69
69
# Make sure that manager_inheritance_from_future is set, since django-polymorphic 1.x already
@@ -78,7 +78,7 @@ def __new__(self, model_name, bases, attrs):
78
78
)
79
79
80
80
# create new model
81
- new_class = self .call_superclass_new_method (model_name , bases , attrs )
81
+ new_class = self .call_superclass_new_method (model_name , bases , attrs , ** kwargs )
82
82
83
83
# check if the model fields are all allowed
84
84
self .validate_model_fields (new_class )
@@ -100,7 +100,7 @@ def __new__(self, model_name, bases, attrs):
100
100
return new_class
101
101
102
102
@classmethod
103
- def call_superclass_new_method (self , model_name , bases , attrs ):
103
+ def call_superclass_new_method (self , model_name , bases , attrs , ** kwargs ):
104
104
"""call __new__ method of super class and return the newly created class.
105
105
Also work around a limitation in Django's ModelBase."""
106
106
# There seems to be a general limitation in Django's app_label handling
@@ -119,7 +119,7 @@ def call_superclass_new_method(self, model_name, bases, attrs):
119
119
if do_app_label_workaround :
120
120
meta .app_label = "poly_dummy_app_label"
121
121
new_class = super (PolymorphicModelBase , self ).__new__ (
122
- self , model_name , bases , attrs
122
+ self , model_name , bases , attrs , ** kwargs
123
123
)
124
124
if do_app_label_workaround :
125
125
del meta .app_label
0 commit comments