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

No description provided.

Copy link

@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!

@@ -1,7 +1,32 @@
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
Copy link

Choose a reason for hiding this comment

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

👍🏽

description = db.Column(db.String, nullable=False)
has_moon = db.Column(db.Boolean, nullable=False, default=False)

def to_dict(self):
Copy link

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!

from .models.planet import Planet
from app import db

def error_message(message, status_code):
Copy link

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

def error_message(message, status_code):
abort(make_response(jsonify(dict(details=message)), status_code))

def validate_planet(planet_id):
Copy link

Choose a reason for hiding this comment

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

functions look good!

@@ -0,0 +1,63 @@
def test_get_planets_with_no_records(client):
Copy link

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