This should be done this way instead:
```python
@property
def input_type(self):
    return 'text' if self.localized else 'number'
```