-
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
Angelica Yee and Genesis Solar System Project Kunzite #27
base: main
Are you sure you want to change the base?
Conversation
Wave 3 start
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.
Looks good! Keep an eye on your responses, though. You want to keep them as consistent as possible and include a status code
#app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get( | ||
# "SQLALCHEMY_DATABASE_URI") |
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.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get( | |
# "SQLALCHEMY_DATABASE_URI") |
Let's remove commented code if we aren't using it
planet= db.relationship("Planet", back_populates="moons") | ||
planet_id= db.Column(db.Integer, db.ForeignKey('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.
planet= db.relationship("Planet", back_populates="moons") | |
planet_id= db.Column(db.Integer, db.ForeignKey('planet.id')) | |
planet = db.relationship("Planet", back_populates="moons") | |
planet_id = db.Column(db.Integer, db.ForeignKey('planet.id')) |
db.session.delete(planet) | ||
db.session.commit() | ||
|
||
return make_response(f"Planet#{planet.id} successfully deleted") |
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.
whoops, you forgot your status code
planet=validate_model(Planet, planet_id) | ||
request_body=request.get_json() | ||
|
||
if request_body.get("name") is None or request_body.get("description") is None or request_body.get("moons") is None: |
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.
if request_body.get("name") is None or request_body.get("description") is None or request_body.get("moons") is None: | |
if request_body.get("name") is None or \ | |
request_body.get("description") is None or \ | |
request_body.get("moons") is None: |
No description provided.