diff --git a/docs/changelog.rst b/docs/changelog.rst index b49522cdb..b55ddda9b 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -23,6 +23,8 @@ Modifications to existing flavors: (`gh-305 `_). - Added support for Swedish interim personal identity numbers (`gh-308 `_). +- Deprecated `nl.models.NLBankAccountNumberField`. + (`gh-307 `_). Other changes: diff --git a/localflavor/nl/models.py b/localflavor/nl/models.py index 0f7deeab6..c00e92363 100644 --- a/localflavor/nl/models.py +++ b/localflavor/nl/models.py @@ -121,9 +121,20 @@ class NLBankAccountNumberField(models.CharField): This model field uses :class:`validators.NLBankAccountNumberFieldValidator` for validation. .. versionadded:: 1.1 + + .. deprecated:: 1.6 + Use `localflavor.generic.models.IBANField` with included_countries=('nl') option instead. + Note that a data migration is required to move the data from this field to a new IBANField: + it needs to calculate check digits, add the bank identifier and zero-pad the bank number + into a proper IBAN. """ def __init__(self, *args, **kwargs): + self.system_check_deprecated_details = { + 'msg': self.__class__.__name__ + ' is deprecated.', + 'hint': "Use `localflavor.generic.models.IBANField` with included_countries=('nl') option instead." + } + kwargs.setdefault('max_length', 10) super(NLBankAccountNumberField, self).__init__(*args, **kwargs) # Ensure that only the NLBankAccountNumberFieldValidator is set.