def get_total_ticket_comments(ticket):
    """ Return the total number of comments for the given ticket """

    total_comments = 0
    for comment in ticket.comments.all():
        total_comments += comment.count()
    return total_comments