summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/events.py
diff options
context:
space:
mode:
authorBrian <bmc@shmoo.com>2016-12-17 12:09:13 -0500
committerBrian <bmc@shmoo.com>2016-12-17 12:09:13 -0500
commit3c0fc9b95f458f608bf10c266e52b2cd919467d5 (patch)
tree48ddf15c77f74e2118ca7bfda943327daafa2856 /lib/sqlalchemy/orm/events.py
parenta1de76c42f6b64808448aed6e821fbb3b988f99b (diff)
downloadsqlalchemy-3c0fc9b95f458f608bf10c266e52b2cd919467d5.tar.gz
fix example re such that the listen modifier example works
Diffstat (limited to 'lib/sqlalchemy/orm/events.py')
-rw-r--r--lib/sqlalchemy/orm/events.py2
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