def validate(postcode):
    postcode = postcode.strip()
    if postcode.isdigit():
        return postcode
    else:
        raise ValueError(_('Invalid Australian postal code'))
Validates Australian postal codes.
dataset/ETHPy150Open dokterbob/satchmo/satchmo/apps/l10n/validators/aupostcode.py/validate