added an is_true function
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 9 Jan 2008 14:52:48 +0000 (14:52 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 9 Jan 2008 14:52:48 +0000 (14:52 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@8361 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/python/oils/utils/utils.py

index 4735a9f..47c939e 100644 (file)
@@ -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'''