diff --git a/pydal/objects.py b/pydal/objects.py index 2bc068812..80cdd2874 100644 --- a/pydal/objects.py +++ b/pydal/objects.py @@ -1626,7 +1626,9 @@ def __init__(self, fieldname, type='string', length=None, default=DEFAULT, self.notnull = notnull self.unique = unique # split to deal with decimal(,) - self.regex = regex or DEFAULT_REGEX.get(self.type.split('(')[0]) + self.regex = regex + if not regex and isinstance(self.type, str): + self.regex = DEFAULT_REGEX.get(self.type.split('(')[0]) self.options = options self.uploadfield = uploadfield self.uploadfolder = uploadfolder