Created
August 8, 2012 14:59
-
-
Save major/3295666 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _regexp_filter_by_column(instance, filter_name, filter_re): | |
try: | |
v = getattr(instance, filter_name) | |
except AttributeError: | |
return True | |
if v and filter_re.match(str(v.encode('utf-8'))): | |
return True | |
return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment