def find_subscriber_with_nick(self, nick): SubscriberQuery = Query() res = self.subscriber_table.get(SubscriberQuery.nick == nick) return Subscriber.from_dict(res) if res else None
def find_subscribers_with_statuses(self, statuses): SubscriberQuery = Query() res = [] for status in statuses: res.extend(self.subscriber_table.search(SubscriberQuery.status == status)) return [Subscriber.from_dict(s) for s in res]