-
Notifications
You must be signed in to change notification settings - Fork 72
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
Rock - Delia #73
base: main
Are you sure you want to change the base?
Rock - Delia #73
Conversation
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.
Awesome job Delia!! You hit all the learning goals and completed all the user stories for this project. Overall, your code was well-organized and easy to read. I've added some comments for refactoring and ways to make your logic more robust 💪
Overall, great job and keep up the hard work 🔥 ✨
|
||
if video == None: | ||
return "This video has not been found" | ||
|
||
elif video.isalpha(): | ||
response = video_store.list_one_video(title=video) | ||
elif video.isdigit(): | ||
response = video_store.list_one_video(id=int(video)) |
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.
A good edge case to handle is invalid inputs? Providing some logic that will notify the user about invalid data being entered and then asking to 'Enter a video title or id' again would be really helpful and improve the overall ux of the cli.
return "This customer has not been found" |
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.
This particular logic could also expand out to invalid data.
if customer == None: | |
return "This customer has not been found" | |
if customer == None: | |
return "This customer has not been found" |
|
||
run_cli() | ||
|
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.
Delia! Your main.py
file is really neat and easy to read! Great job in separating out the requests from this menu logic.
def make_choice(options): | ||
valid_choices = options.keys() | ||
choice = input("\nPlease select option: ") |
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.
Adding some detail on how the user can see all the options would be really helpful as the previously displayed menu can get pushed up after doing a few commands.
choice = input("\nPlease select option: ") | |
choice = input("\nPlease select option or enter 15 to see all options again: ") |
self.selected_video = None | ||
return response.json() |
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.
Adding some logic to check if the response returns a "video not found" and then printing a message that describes the video not being found would be really helpful to the user.
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.
Currently I can type in an invalid video and/or customer and the CLI crashes.
response = requests.get(self.url + f"/videos/{video_id}/rentals") | ||
print(response.text) | ||
return response.json() | ||
|
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.
Great job in separating your requests from main.py
. In a future refactor, you could separate customer, rental, and video requests into different files to further modularize your code 😄
No description provided.