From b97d5a5327882c18b7d12e3851e12157c73bf1a7 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 9 Jan 2008 14:52:48 +0000 Subject: [PATCH] added an is_true function git-svn-id: svn://svn.open-ils.org/ILS/trunk@8361 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/python/oils/utils/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) 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''' -- 2.11.0