Skip to content

Pine - Mariah and Kayla#14

Open
khuddleup wants to merge 9 commits into
Ada-C16:mainfrom
khuddleup:main
Open

Pine - Mariah and Kayla#14
khuddleup wants to merge 9 commits into
Ada-C16:mainfrom
khuddleup:main

Conversation

@khuddleup
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@jbieniosek jbieniosek left a 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.

Comment thread app/routes.py Outdated
"description" : planet.description,
"num_moons" : planet.num_moons
})
return jsonify(planets_response)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment thread app/routes.py Outdated
}
return jsonify(response)

return 'Planet ID not found', 404
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💯

Comment thread app/routes.py Outdated
"description" : planet.description,
"num_moons" : planet.num_moons
}
return jsonify(response)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice!

Copy link
Copy Markdown

@CheezItMan CheezItMan left a 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.

Comment thread app/__init__.py
db = SQLAlchemy()
migrate = Migrate()

DATABASE_CONNECTION_STRING = 'postgresql+psycopg2://postgres:postgres@localhost:5432/solar_system_development'
Copy link
Copy Markdown

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.

Comment thread app/models/planets.py
description = db.Column(db.String(64))
num_moons = db.Column(db.Integer)

def to_dict(self):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍 Nice helper!

Comment thread app/routes.py
Comment on lines +7 to +8
@planets_bp.route("", methods=["GET"])
def get_planets():
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment thread app/routes.py
Comment on lines +16 to +17
@planets_bp.route("/<planet_id>", methods=["GET", "PUT", "DELETE"])
def handle_planet(planet_id):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment thread app/routes.py
Comment on lines +44 to +45
@planets_bp.route("", methods=["POST"])
def create_new_planet():
Copy link
Copy Markdown

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

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.

4 participants