# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
-# $Id: Persons.py,v 1.29 2007/01/08 16:34:12 tmack Exp $
+# $Id: Persons.py,v 1.31 2007/01/09 16:22:49 mlhuang Exp $
#
from types import StringTypes
rest = email[at_sign+1:]
domain = rest.split('.')
- # This means local, unqualified addresses, are no allowed
+ # This means local, unqualified addresses, are not allowed
if not domain:
raise invalid_email
if len(domain) < 2:
database.
"""
- def __init__(self, api, person_filter = None, columns = None, peer_id = None):
+ def __init__(self, api, person_filter = None, columns = None):
Table.__init__(self, api, Person, columns)
sql = "SELECT %s FROM view_persons 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 person_filter is not None:
if isinstance(person_filter, (list, tuple, set)):
# Separate the list into integers and strings
elif isinstance(person_filter, dict):
person_filter = Filter(Person.fields, person_filter)
sql += " AND (%s)" % person_filter.sql(api, "AND")
+
self.selectall(sql)