object_types = None, object_ids = None, fault_codes = None):
self.api = api
-
+
sql = "SELECT %s from view_events WHERE True" % ", ".join(Event.fields)
if event_ids:
if object_types:
sql += " AND object_type in (%s)" % ", ".join(api.db.quote(object_types))
-
+
+ if fault_codes:
+ sql += " And fault_code in (%s)" % ", ".join(map(str, fault_codes))
+
rows = self.api.db.selectall(sql)
-
+
for row in rows:
self[row['event_id']] = event = Event(api, row)
for aggregate in ['object_ids']: