def pregnancy_length_list(pregs):
    """
    Gets the pregnancy length list

    Args:
        pregs: the pregnancies from the DB

    Returns:
        the lengths of the pregnancies
    """
    lengths = [ record.prglength for record in pregs.records if record.outcome
            == 1 ]
    return lengths