add backward compatible SliceGetTicket and SliceTicketGet functions for Emulab during...
[plcapi.git] / PLC / AddressTypes.py
index 67de84e..19f9b16 100644 (file)
@@ -4,7 +4,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2006 The Trustees of Princeton University
 #
-# $Id: AddressTypes.py,v 1.6 2006/10/25 14:29:13 mlhuang Exp $
+# $Id: AddressTypes.py,v 1.8 2006/11/09 03:07:42 mlhuang Exp $
 #
 
 from types import StringTypes
@@ -46,14 +46,14 @@ class AddressTypes(Table):
     Representation of the address_types table in the database.
     """
 
-    def __init__(self, api, address_type_filter = None):
-       Table.__init__(self, api, AddressType)
+    def __init__(self, api, address_type_filter = None, columns = None):
+       Table.__init__(self, api, AddressType, columns)
 
         sql = "SELECT %s FROM address_types WHERE True" % \
-              ", ".join(AddressType.fields)
+              ", ".join(self.columns)
 
         if address_type_filter is not None:
-            if isinstance(address_type_filter, list):
+            if isinstance(address_type_filter, (list, tuple, set)):
                 # Separate the list into integers and strings
                 ints = filter(lambda x: isinstance(x, (int, long)), address_type_filter)
                 strs = filter(lambda x: isinstance(x, StringTypes), address_type_filter)