From: erickson Date: Wed, 9 Jan 2008 14:54:40 +0000 (+0000) Subject: added an is_true function X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=611b1d5675a01eca447572959dc0f6eda6541136;p=Evergreen.git added an is_true function git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@8362 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/python/oils/utils/utils.py b/Open-ILS/src/python/oils/utils/utils.py index 4735a9f02c..47c939ece6 100644 --- a/Open-ILS/src/python/oils/utils/utils.py +++ b/Open-ILS/src/python/oils/utils/utils.py @@ -49,6 +49,12 @@ def unique(arr): o[x] = 1 return o.keys() +def is_db_true(data): + ''' Returns true if the data provided matches what the database considers a true value ''' + if not data or data == 'f' or str(data) == '0': + return False + return True + def login(username, password, type=None, workstation=None): ''' Login to the server and get back an authtoken'''