# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
-# $Id: NodeGroups.py,v 1.16 2006/11/02 18:32:55 mlhuang Exp $
+# $Id: NodeGroups.py,v 1.18 2006/11/09 03:07:42 mlhuang Exp $
#
from types import StringTypes
database.
"""
- def __init__(self, api, nodegroup_filter = None):
- Table.__init__(self, api, NodeGroup)
+ def __init__(self, api, nodegroup_filter = None, columns = None):
+ Table.__init__(self, api, NodeGroup, columns)
sql = "SELECT %s FROM view_nodegroups WHERE True" % \
- ", ".join(NodeGroup.fields)
+ ", ".join(self.columns)
if nodegroup_filter is not None:
- if isinstance(nodegroup_filter, list):
+ if isinstance(nodegroup_filter, (list, tuple, set)):
# Separate the list into integers and strings
ints = filter(lambda x: isinstance(x, (int, long)), nodegroup_filter)
strs = filter(lambda x: isinstance(x, StringTypes), nodegroup_filter)