Exemple #1
0
def review_box(user_id, review, movie_name):
    author = f.get_name_of_object(review["user_id"], users_col)
    msgbox(
        "Autor recenzji: " + author + "\n" + "Tytuł: " + movie_name + "\n" +
        "Ocena: " + str(review["rating"]) + "\n" + "Recenzja: " + "\n" +
        str(review["text"]), title)
    menu_box(user_id)
Exemple #2
0
def reviews_of_movie_box(movie_name, user_id):
    reviews = f.find_movie_reviews(movie_name, movies_col, reviews_col)
    if reviews.count() == 0:
        msgbox("Ten film nie ma ocen", title)
        menu_box(user_id)
    else:
        review_names = []
        review_objects = []
        for review in reviews:
            review_objects.append(review)
            review_names.append(
                f.get_name_of_object(review['user_id'], users_col))
        choice = choicebox("Recenzje filmu:", title, review_names)
        review_box(user_id, review_objects[review_names.index(choice)],
                   movie_name)
Exemple #3
0
def my_reviews_box(user_id):
    reviews = f.find_user_reviews(user_id, reviews_col)
    if reviews.count() == 0:
        msgbox("Nie oceniłeś/aś żadnych filmów", title)
        menu_box(user_id)
    else:
        reviews_names_obj = {}
        for review in reviews:
            movie_id = review["movie_id"]
            reviews_names_obj[f.get_name_of_object(movie_id,
                                                   movies_col)] = review
        reviews_names = []
        for name in reviews_names_obj.keys():
            reviews_names.append(name)
        choice = choicebox("Twoje oceny", title, reviews_names)
        chosen_review = reviews_names_obj[choice]
        review_box(user_id, chosen_review, choice)
Exemple #4
0
def review_added(user_id, movie_id):
    msgbox(
        "Pomyślnie dodano recenzję filmu " +
        str(f.get_name_of_object(movie_id, movies_col)), title)
    menu_box(user_id)