def getGenreList(books):
    """
        Return the list of genres/categories of the books given a books object
        (from database query).
    """
    genres = []
    for book in books:
        if book.category:
            genre = book.category
            if genre not in genres:
                genres.append(genre)

    return genres