I have a subclass of DecimalField with a widget member set, like so:
class ParameterField(DecimalField):
widget = ParameterWidget
This works in Django 1.5 (by way of the constructor of Field, I guess). Django 1.6 doesn't pick up the specialised widget. IntegerField does a setdefault on widget that I can't follow:
class IntegerField(Field):
...
def __init__(self, max_value=None, min_value=None, *args, **kwargs):
self.max_value, self.min_value = max_value, min_value
kwargs.setdefault('widget', NumberInput if not kwargs.get('localize') else self.widget)
super(IntegerField, self).__init__(*args, **kwargs)
Adding localize = False
to the ParameterField class doesn't help because that doesn't make it appear in kwargs for IntegerField.
Suggested fix