Open
Conversation
jmaddox19
reviewed
May 21, 2021
jmaddox19
left a comment
There was a problem hiding this comment.
SO AMAZING! It's clear you had so much fun with this project and that there was a lot of thoughtfulness in how this was implemented!
Comment on lines
+12
to
+21
| def to_json_format(self): | ||
| task_to_json = { | ||
| "id": self.task_id, | ||
| "title": self.title, | ||
| "description": self.description, | ||
| "is_complete": True if self.completed_at is not None else False, | ||
| } | ||
| if self.goal is not None: | ||
| task_to_json["goal_id"] = self.goal | ||
| return task_to_json |
| tasks_bp = Blueprint("tasks", __name__, url_prefix="/tasks") | ||
| goals_bp = Blueprint("goals", __name__, url_prefix="/goals") | ||
|
|
||
| def err_404(): |
| return jsonify({"task": single_task.to_json_format()}) | ||
|
|
||
|
|
||
| def validate_field(field, dic): |
There was a problem hiding this comment.
SOOOO COOOL! This is honestly another level of developer thinking, to abstract out the very idea of validation into one function like this!
There was a problem hiding this comment.
This could be taken even one step further by allowing an optional 3rd param for expected_type, which the function could use to verify that the type of the field is the type that's expected.
| ongoing_task.completed_at = datetime.utcnow() | ||
| db.session.commit() | ||
|
|
||
| glados = GLaDOS() |
| import os | ||
| import requests | ||
|
|
||
| class GLaDOS(): |
There was a problem hiding this comment.
Oh my god this is my new favorite program OF ALL TIME!!!! :D
Comment on lines
+16
to
+21
| def add_task_response_to_json(self): | ||
|
|
||
| return { | ||
| "id": self.goal_id, | ||
| "task_ids": [t.task_id for t in self.tasks] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.