diff options
| author | Brian <bmc@shmoo.com> | 2016-12-17 12:09:13 -0500 |
|---|---|---|
| committer | Brian <bmc@shmoo.com> | 2016-12-17 12:09:13 -0500 |
| commit | 3c0fc9b95f458f608bf10c266e52b2cd919467d5 (patch) | |
| tree | 48ddf15c77f74e2118ca7bfda943327daafa2856 /lib/sqlalchemy/orm | |
| parent | a1de76c42f6b64808448aed6e821fbb3b988f99b (diff) | |
| download | sqlalchemy-3c0fc9b95f458f608bf10c266e52b2cd919467d5.tar.gz | |
fix example re such that the listen modifier example works
Diffstat (limited to 'lib/sqlalchemy/orm')
| -rw-r--r-- | lib/sqlalchemy/orm/events.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/events.py b/lib/sqlalchemy/orm/events.py index 992f29623..6bb773536 100644 --- a/lib/sqlalchemy/orm/events.py +++ b/lib/sqlalchemy/orm/events.py @@ -1812,7 +1812,7 @@ class AttributeEvents(event.Events): def validate_phone(target, value, oldvalue, initiator): "Strip non-numeric characters from a phone number" - return re.sub(r'(?![0-9])', '', value) + return re.sub(r'\D', '', value) # setup listener on UserContact.phone attribute, instructing # it to use the return value |
