def __init__(self, match, _session): self._session = _session self.id = match["_id"] self.user, self.messages = None, [] if 'person' in match: user_data = _session._api.user_info( match['person']['_id'])['results'] user_data['_id'] = match['person']['_id'] self.user = User(user_data, _session) self.messages = [ Message(m, user=self.user) for m in match['messages'] ]
def __init__(self, match, _session): self._session = _session self.id = match["_id"] self.user, self.messages = None, [] self.match_date = datetime.datetime.strptime(match["created_date"], "%Y-%m-%dT%H:%M:%S.%fZ") if 'person' in match: user_data = _session._api.user_info( match['person']['_id'])['results'] user_data['_id'] = match['person']['_id'] self.user = User(user_data, _session) self.messages = [ Message(m, user=self.user) for m in match['messages'] ]