-
Notifications
You must be signed in to change notification settings - Fork 1k
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 #560
base: master
Are you sure you want to change the base?
solution #560
Conversation
main.py
Outdated
Genre.objects.create(name="Western") | ||
Genre.objects.create(name="Action") | ||
Genre.objects.create(name="Dramma") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use loop instead of duplicate code
main.py
Outdated
Actor.objects.create(first_name="George", last_name="Klooney") | ||
Actor.objects.create(first_name="Kianu", last_name="Reaves") | ||
Actor.objects.create(first_name="Scarlett", last_name="Keegan") | ||
Actor.objects.create(first_name="Will", last_name="Smith") | ||
Actor.objects.create(first_name="Jaden", last_name="Smith") | ||
Actor.objects.create(first_name="Scarlett", last_name="Johansson") | ||
Genre.objects.filter(name="Dramma").update(name="Drama") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use loop instead of duplicate code
main.py
Outdated
(Actor.objects.filter(first_name="George").filter(last_name="Klooney") | ||
.update(last_name="Clooney")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
brackets are redundant. Also no need to use two filters. Fix in all places
(Actor.objects.filter(first_name="George").filter(last_name="Klooney") | |
.update(last_name="Clooney")) | |
Actor.objects.filter( | |
first_name="George", last_name="Klooney" | |
).update(last_name="Clooney")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done!
No description provided.