-
Notifications
You must be signed in to change notification settings - Fork 36
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
Pine - Mariah and Kayla #14
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 this project! This project is green.
app/routes.py
Outdated
"description" : planet.description, | ||
"num_moons" : planet.num_moons | ||
}) | ||
return jsonify(planets_response) |
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.
👍
app/routes.py
Outdated
} | ||
return jsonify(response) | ||
|
||
return 'Planet ID not found', 404 |
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.
💯
app/routes.py
Outdated
"description" : planet.description, | ||
"num_moons" : planet.num_moons | ||
} | ||
return jsonify(response) |
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.
Nice!
…atabase and refactors get_planets and get_planet routes accordingly
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.
Nice work Y'all, you hit the learning goals here. Well done. I left a few comments, but this is pretty solid.
db = SQLAlchemy() | ||
migrate = Migrate() | ||
|
||
DATABASE_CONNECTION_STRING = 'postgresql+psycopg2://postgres:postgres@localhost:5432/solar_system_development' |
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.
I suggest that you should use an environment variable for the connection string instead of leaving the string hard-coded here in the __init__.py
file.
description = db.Column(db.String(64)) | ||
num_moons = db.Column(db.Integer) | ||
|
||
def to_dict(self): |
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.
👍 Nice helper!
@planets_bp.route("", methods=["GET"]) | ||
def get_planets(): |
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.
👍
@planets_bp.route("/<planet_id>", methods=["GET", "PUT", "DELETE"]) | ||
def handle_planet(planet_id): |
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.
👍
@planets_bp.route("", methods=["POST"]) | ||
def create_new_planet(): |
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.
👍 Nice use of try-except
No description provided.