-
Notifications
You must be signed in to change notification settings - Fork 69
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
Zoisite Say R. & Izzy B. #18
base: main
Are you sure you want to change the base?
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.
Great work on waves 1 and 2 for Solar System, Say & Izzy! It looks like you've got a handle on creating a blueprint, registering it with your Flask app, and writing routes. I like the code refactors so that the routes can stay short and sweet!
app/routes.py
Outdated
result_list = [] | ||
|
||
for planet in planets: | ||
result_list.append(planet.planet_to_dict()) |
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 would be a good candidate for a list comprehension, what could that look like?
app/routes.py
Outdated
@planets_bp.route("/<id>", methods=["GET"]) | ||
def handle_planet(id): | ||
planet = validate_planet(id) | ||
return planet.planet_to_dict() |
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.
It's not a rule and the code still executes just fine, but usually we'd see all the routes grouped together and all the helpers methods grouped together in a file.
added new pytest for empty database
No description provided.