Skip to content

Commit e3c779a

Browse files
committed
[fixes #2] Fixed the use of super method
1 parent 2c673b5 commit e3c779a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

djangoplugins/fields.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
class PluginField(models.ForeignKey):
11-
def __init__(self, point=None, **kwargs):
11+
def __init__(self, point=None, *args, **kwargs):
1212
# Normal path.
1313
if point is not None:
1414
kwargs['limit_choices_to'] = {
@@ -18,11 +18,11 @@ def __init__(self, point=None, **kwargs):
1818
else:
1919
if "to" in kwargs:
2020
del kwargs["to"]
21-
super(PluginField, self).__init__(Plugin, **kwargs)
21+
super(PluginField, self).__init__(Plugin, *args, **kwargs)
2222

2323

2424
class ManyPluginField(models.ManyToManyField):
25-
def __init__(self, point=None, **kwargs):
25+
def __init__(self, point=None, *args, **kwargs):
2626
# Normal path.
2727
if point is not None:
2828
kwargs['limit_choices_to'] = {
@@ -32,7 +32,7 @@ def __init__(self, point=None, **kwargs):
3232
else:
3333
if "to" in kwargs:
3434
del kwargs["to"]
35-
super(ManyPluginField, self).__init__(Plugin, **kwargs)
35+
super(ManyPluginField, self).__init__(Plugin, *args, **kwargs)
3636

3737

3838
def get_plugins_qs(point):
@@ -43,7 +43,7 @@ class PluginChoiceField(forms.ModelChoiceField):
4343
def __init__(self, point, *args, **kwargs):
4444
kwargs['to_field_name'] = 'name'
4545
super(PluginChoiceField, self).\
46-
__init__(queryset=get_plugins_qs(point), *args, **kwargs)
46+
__init__(queryset=get_plugins_qs(point), **kwargs)
4747

4848
def to_python(self, value):
4949
value = super(PluginChoiceField, self).to_python(value)
@@ -57,16 +57,16 @@ class PluginMultipleChoiceField(forms.ModelMultipleChoiceField):
5757
def __init__(self, point, *args, **kwargs):
5858
kwargs['to_field_name'] = 'name'
5959
super(PluginMultipleChoiceField, self).\
60-
__init__(queryset=get_plugins_qs(point), *args, **kwargs)
60+
__init__(queryset=get_plugins_qs(point), **kwargs)
6161

6262

6363
class PluginModelChoiceField(forms.ModelChoiceField):
6464
def __init__(self, point, *args, **kwargs):
6565
super(PluginModelChoiceField, self).\
66-
__init__(queryset=get_plugins_qs(point), *args, **kwargs)
66+
__init__(queryset=get_plugins_qs(point), **kwargs)
6767

6868

6969
class PluginModelMultipleChoiceField(forms.ModelMultipleChoiceField):
7070
def __init__(self, point, *args, **kwargs):
7171
super(PluginModelMultipleChoiceField, self).\
72-
__init__(queryset=get_plugins_qs(point), *args, **kwargs)
72+
__init__(queryset=get_plugins_qs(point), **kwargs)

0 commit comments

Comments
 (0)