# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
-# $Id: Nodes.py,v 1.28 2006/12/05 16:45:03 thierry Exp $
+# $Id: Nodes.py,v 1.29 2007/01/09 16:13:36 mlhuang Exp $
#
from types import StringTypes
database.
"""
- def __init__(self, api, node_filter = None, columns = None, peer_id = None):
+ def __init__(self, api, node_filter = None, columns = None):
Table.__init__(self, api, Node, columns)
sql = "SELECT %s FROM view_nodes WHERE deleted IS False" % \
", ".join(self.columns)
- if peer_id is None:
- sql += " AND peer_id IS NULL"
- elif isinstance(peer_id, (int, long)):
- sql += " AND peer_id = %d" % peer_id
-
if node_filter is not None:
if isinstance(node_filter, (list, tuple, set)):
# Separate the list into integers and strings