Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution #1121

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Solution #1121

wants to merge 4 commits into from

Conversation

rzaliznyi
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your code is almost there, but there are a couple of critical issues that need to be addressed before we can approve it. The update logic for the Actor model is incorrect; make sure to filter by first_name='Kianu' and update it to first_name='Keanu'. Additionally, the Genre model update should target the name field, not genre. Once these are fixed, your solution will be ready to go! Keep up the great work! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review button in the Reviewers tab.

main.py Outdated
Actor.objects.create(first_name="Jaden", last_name="Smith")
Actor.objects.create(first_name="Scarlett", last_name="Johansson")

Genre.objects.filter(name="Dramma").update(genre="Drama")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The update operation on Genre is incorrect. The field genre does not exist in the Genre model. You likely intended to update the name field from 'Dramma' to 'Drama'.

main.py Outdated

Genre.objects.filter(name="Dramma").update(genre="Drama")
Actor.objects.filter(last_name="Klooney").update(last_name="Clooney")
Actor.objects.filter(last_name="Keanu").update(last_name="Reeves")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filter condition for updating the Actor model is incorrect. The last name 'Keanu' does not match any existing record. You probably meant to filter by first_name='Kianu' and update first_name='Keanu'.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great effort on setting up the Django models and migrations! 🎉 However, there are a few critical issues that need attention:

  1. Field Name for Genre Model: The Genre model should have a name field with a maximum length of 255 characters, but it's currently using genre. Please update this to align with the task requirements.

  2. Update Logic for Genre: In main.py, ensure the update logic targets the name field instead of genre.

  3. Update Logic for Actor: The update logic should filter by first_name='Kianu' and update it to first_name='Keanu'.

  4. Unnecessary Migration File: The migration file 0002_rename_name_genre_genre.py is unnecessary and contradicts the task requirements. Please remove or correct it.

These changes are crucial for the functionality of your code. Addressing them will help you improve and learn from this experience. Keep up the good work and continue refining your skills! 🚀

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

main.py Outdated

Genre.objects.filter(genre="Dramma").update(genre="Drama")
Actor.objects.filter(last_name="Klooney").update(last_name="Clooney")
Actor.objects.filter(last_name="Keanu").update(last_name="Reeves")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The update logic for the Actor model is incorrect. You should filter by first_name='Kianu' and update it to first_name='Keanu'.

Copy link

@pavlopro pavlopro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants