Skip to content

Feature/todo list #285

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

Merged
merged 26 commits into from
Feb 26, 2021
Merged

Conversation

liaarbel
Copy link

I created a tasks list for every day in dayview by clicking on the button create task you can add task to the daily tasks list.
by clicking on the button todo list you can see all your daily tasks sorted by time and marked by important or not.
after you finish a task you can mark the task Done.

@codecov-io
Copy link

codecov-io commented Feb 14, 2021

Codecov Report

Merging #285 (4730360) into develop (3c22c8c) will increase coverage by 0.03%.
The diff coverage is 96.25%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #285      +/-   ##
===========================================
+ Coverage    94.54%   94.57%   +0.03%     
===========================================
  Files           85       87       +2     
  Lines         3997     4076      +79     
===========================================
+ Hits          3779     3855      +76     
- Misses         218      221       +3     
Impacted Files Coverage Δ
app/main.py 95.23% <ø> (ø)
app/routers/todo_list.py 94.64% <94.64%> (ø)
app/database/models.py 97.29% <100.00%> (+0.11%) ⬆️
app/internal/todo_list.py 100.00% <100.00%> (ø)
app/routers/dayview.py 99.24% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c22c8c...cc67d8e. Read the comment docs.

Copy link
Member

@yammesicka yammesicka left a comment

Choose a reason for hiding this comment

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

That's a good start! I have added few insights :)

return task


def sort_by_time(tasks: List[Task]) -> List[Task]:
Copy link
Member

Choose a reason for hiding this comment

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

Prefer sorting in the database, it's probably faster

Copy link
Author

Choose a reason for hiding this comment

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

But the most logical thing to do is to sort your daily task by the time they happen

Copy link
Member

Choose a reason for hiding this comment

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

You're right - I meant to order them when you querying the database using sort by

Copy link
Member

@yammesicka yammesicka left a comment

Choose a reason for hiding this comment

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

Looks great :) Fix the minor issues and we're ready to go

Comment on lines 214 to 218
tasks = (session.query(Task)
.filter(Task.owner_id == user.user_id)
.filter(Task.date == day.date())
.order_by(Task.time)
)
Copy link
Member

Choose a reason for hiding this comment

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

Please use precommit hooks to reformat

Copy link
Author

Choose a reason for hiding this comment

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

fixed

status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
)
return RedirectResponse(
url=f"/day/{date_str}",
Copy link
Member

Choose a reason for hiding this comment

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

Use url_for on all those places

Copy link
Author

Choose a reason for hiding this comment

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

fixed


function openEditModal(event){
const modal = document.getElementById('edit-modal');
console.log(event);
Copy link
Member

Choose a reason for hiding this comment

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

Remove console.log parts

Copy link
Author

Choose a reason for hiding this comment

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

fixed

data-bs-dismiss="modal"
aria-label="Close"></button>
</div>
<form action="/task/edit" method="post">
Copy link
Member

Choose a reason for hiding this comment

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

Use url_for wherever relevant

Copy link
Author

Choose a reason for hiding this comment

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

fixed


def test_if_task_deleted(home_test_client, task1: Task, session):
response = home_test_client.post(
"/task/delete",
Copy link
Member

Choose a reason for hiding this comment

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

url_for

Copy link
Author

Choose a reason for hiding this comment

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

fixed

Comment on lines 1 to 9
//function openEditModal(taskId, taskTime, taskTitle, taskDescription, taskImportant){
// $('#list-modal').modal('toggle');
// $('#edit-task-id').val(taskId);
// $('#customer-time2').val(taskTime);
// $('#customer-title2').val(taskTitle);
// $('#customer-descrip2').val(taskDescription);
// $('#is-important2').prop('checked', taskImportant);
// $('#edit-modal').modal('toggle');
//}
Copy link
Member

Choose a reason for hiding this comment

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

Remove commented code

Copy link
Author

Choose a reason for hiding this comment

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

fixed

@yammesicka yammesicka merged commit 55daca5 into PythonFreeCourse:develop Feb 26, 2021
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.

5 participants