def update(action: str, record: QuerySet) -> None:
    if (action not in summary):
        summary[action] = dict(count=record.count, last_visit=record.last_visit)
    else:
        summary[action]['count'] += record.count
        summary[action]['last_visit'] = max(summary[action]['last_visit'], record.last_visit)
def update(action: str, record: QuerySet) -> None:
    if (action not in summary):
        summary[action] = dict(count=record.count, last_visit=record.last_visit)
    else:
        summary[action]['count'] += record.count
        summary[action]['last_visit'] = max(summary[action]['last_visit'], record.last_visit)