Skip to content

Sea Turtles - Nina G. (Waves 3-6)#31

Open
anacapamu wants to merge 10 commits intoada-c17:mainfrom
anacapamu:main
Open

Sea Turtles - Nina G. (Waves 3-6)#31
anacapamu wants to merge 10 commits intoada-c17:mainfrom
anacapamu:main

Conversation

@anacapamu
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@tgoslee tgoslee left a comment

Choose a reason for hiding this comment

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

Great job Nina!

Comment thread app/__init__.py
@@ -1,7 +1,32 @@
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
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/models/planet.py
description = db.Column(db.String, nullable=False)
has_moon = db.Column(db.Boolean, nullable=False, default=False)

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 methods and use of a classmethod!

Comment thread app/routes.py
from .models.planet import Planet
from app import db

def error_message(message, status_code):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

you could move your helper functions to a file helper_functions.py to clean up your routes file

Comment thread app/routes.py
def error_message(message, status_code):
abort(make_response(jsonify(dict(details=message)), status_code))

def validate_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.

functions look good!

Comment thread tests/test_routes.py
@@ -0,0 +1,63 @@
def test_get_planets_with_no_records(client):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

test routes look good!

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.

2 participants