dbservice.get_record_list: do not use parse_pgarray on python lists
authorTarvi Pillessaar <tarvi.pillessaar@skype.net>
Wed, 23 May 2012 13:09:45 +0000 (16:09 +0300)
committerTarvi Pillessaar <tarvi.pillessaar@skype.net>
Wed, 23 May 2012 13:09:45 +0000 (16:09 +0300)
python/skytools/dbservice.py

index e49576ce033696d9030bfed3b967b3c2b6422854..d1ddb666e3e03d338cd44447d65f7b74fa0994da 100755 (executable)
@@ -92,7 +92,11 @@ def get_record_list(array):
     """
     if array is None:
         return []
-    return map(get_record, skytools.parse_pgarray(array))
+
+    if isinstance(array, list):
+        return map(get_record, array)
+    else:
+        return map(get_record, skytools.parse_pgarray(array))
 
 def get_record_lists(tbl, field):
     """ Create dictionary of lists from given list using field as grouping criteria