def create_etag(pairs: List[Tuple[QuerySet, str]]) -> str:
    """
    Turn a list of queryset and timestamp pairs into an etag. The latest
    timestamp will be chosen as the etag
    :param pairs: a list of queryset and attribute which holds a timestamp
    :return: an etag
    """
    result = map(lambda p: p[0].aggregate(m=Max(p[1]))['m'], pairs)
    result = filter(lambda r: r is not None, result)
    return str(max(result, default=''))