diff options
author | Filipp Lepalaan <f@230.to> | 2013-12-10 10:41:44 +0200 |
---|---|---|
committer | Filipp Lepalaan <f@230.to> | 2013-12-10 10:41:44 +0200 |
commit | 5e5946542b3b1fcf8d32165d4d45cb640b7e62c0 (patch) | |
tree | 73aa655fee3de914d84435af5ec9c778d8f9cd2c /gsxws/core.py | |
parent | 50d6b97b7a5db599cffc538866bf12edf5d6e3c2 (diff) | |
download | py-gsxws-5e5946542b3b1fcf8d32165d4d45cb640b7e62c0.tar.gz py-gsxws-5e5946542b3b1fcf8d32165d4d45cb640b7e62c0.tar.bz2 py-gsxws-5e5946542b3b1fcf8d32165d4d45cb640b7e62c0.zip |
Added 2014 partNumber format
Diffstat (limited to 'gsxws/core.py')
-rw-r--r-- | gsxws/core.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gsxws/core.py b/gsxws/core.py index 5c771af..548e17b 100644 --- a/gsxws/core.py +++ b/gsxws/core.py @@ -108,6 +108,8 @@ def validate(value, what=None): True >>> validate('ZM661-5883', 'partNumber') True + >>> validate('661-01234', 'partNumber') + True >>> validate('B661-6909', 'partNumber') True >>> validate('blaa', 'serialNumber') @@ -121,7 +123,7 @@ def validate(value, what=None): raise ValueError('%s is not valid input' % value) rex = { - 'partNumber': r'^([A-Z]{1,2})?\d{3}\-?(\d{4}|[A-Z]{1,2})(/[A-Z])?$', + 'partNumber': r'^([A-Z]{1,2})?\d{3}\-?(\d{4,5}|[A-Z]{1,2})(/[A-Z])?$', 'serialNumber': r'^[A-Z0-9]{11,12}$', 'eeeCode': r'^[A-Z0-9]{3,4}$', 'returnOrder': r'^7\d{9}$', |