def __init__(self, *args, **kwargs): kwargs.setdefault('editable', True) kwargs.setdefault('max_digits', 5) kwargs.setdefault('decimal_places', 2) kwargs.setdefault( 'help_text', _('Report in kg. Format is 9.99, 99.99, etc')) DecimalField.__init__(self, *args, **kwargs)
def __init__(self, max_digits=None, decimal_places=None, **kwargs): DecimalField.__init__(self, max_digits=max_digits or self.max_digits, decimal_places=decimal_places or self.decimal_places, **kwargs)