def __call__(self, *args, **kwargs): if self.disabled: kwargs['disabled'] = 'disabled' return TextInput.__call__(self, *args, **kwargs)