Skip to content
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

Maple - Stephanie & Ayaka #42

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Maple - Stephanie & Ayaka #42

wants to merge 16 commits into from

Conversation

ayaka
Copy link

@ayaka ayaka commented Nov 16, 2021

No description provided.

@ayaka ayaka changed the title Maple - Stephpanie & Ayaka Maple - Stephanie & Ayaka Nov 16, 2021
Copy link

@spitsfire spitsfire left a comment

Choose a reason for hiding this comment

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

Wow, wonderful job, Stephani and Ayaka! Your code was very readable, very simple, and understandable. My only feedback for you is to try being more consistent with your return statements when it comes to returning status codes and such. An API's routes should be predictable for other developers to use.

Nicely done!

id = db.Column(db.Integer, primary_key=True)

Choose a reason for hiding this comment

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

👍

videos = db.relationship("Video", secondary="rental", backref="customers")

def to_dict(self):

Choose a reason for hiding this comment

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

👍 yay model methods!

id = db.Column(db.Integer, primary_key=True)

Choose a reason for hiding this comment

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

👍

is_checked_in = db.Column(db.Boolean, default=False)

def to_dict(self):

Choose a reason for hiding this comment

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

👍

id = db.Column(db.Integer, primary_key=True)

Choose a reason for hiding this comment

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

👍

db.session.delete(video)
db.session.commit()

return video.to_dict()

Choose a reason for hiding this comment

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

Suggested change
return video.to_dict()
return video.to_dict(), 200


return video.to_dict()

@videos_bp.route("/<video_id>", methods=["PUT"])

Choose a reason for hiding this comment

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

👍


db.session.commit()

return video.to_dict()

Choose a reason for hiding this comment

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

Suggested change
return video.to_dict()
return video.to_dict(), 200


return video.to_dict()

@videos_bp.route("/<video_id>/rentals", methods=["GET"])

Choose a reason for hiding this comment

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

👍

customer["due_date"] = rental.due_date
customers.append(customer)

return jsonify(customers)

Choose a reason for hiding this comment

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

Suggested change
return jsonify(customers)
return jsonify(customers), 200

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.

3 participants