Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feature/weekly tasks #146

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

Open
issac211 wants to merge 43 commits into PythonFreeCourse:develop
base: develop
Choose a base branch
Loading
from issac211:feature/weekly-tasks

Conversation

@issac211
Copy link
Contributor

@issac211 issac211 commented Jan 29, 2021

Added tables, routers, tests, templates, and internal functions

The fitter gives the option to set weekly tasks.
Comes with a page for managing weekly tasks and another page for editing the task.
Gives the ability to edit, add and delete a weekly task.

Along with this in the feature is included a function for creating the tasks - which aims to create tasks every week for the user (according to the definition of his weekly tasks)

issac211 and others added 11 commits January 24, 2021 21:46
...rs and basic functions for- edit, remove and add + demo functions for demo operations. added basic pages - add_weekly_task.html, weekly_tasks_manager.html
...ted all the demo functions. Arrange the code to be clearer and shorter.
...ode. and added wekly_tasks.py on the intertnal directory
Copy link

codecov-io commented Jan 29, 2021
edited
Loading

Codecov Report

Merging #146 (925e449) into develop (190a274) will increase coverage by 0.20%.
The diff coverage is 100.00%.

Impacted file tree graph

@@ Coverage Diff @@
## develop #146 +/- ##
===========================================
+ Coverage 95.81% 96.01% +0.20% 
===========================================
 Files 75 77 +2 
 Lines 3343 3515 +172 
===========================================
+ Hits 3203 3375 +172 
 Misses 140 140 
Impacted Files Coverage Δ
app/main.py 92.68% <ø> (ø)
app/database/models.py 97.41% <100.00%> (+0.27%) ⬆️
app/internal/weekly_tasks.py 100.00% <100.00%> (ø)
app/routers/weekly_tasks.py 100.00% <100.00%> (ø)

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 190a274...925e449. Read the comment docs.

Copy link
Member

Great work! I've added few of my insights :)

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.

Awesome work! Let's make another little push :)

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.

Great improvement!



@pytest.fixture(scope="session")
def weekly_tasks_test_client():
Copy link
Member

@yammesicka yammesicka Feb 7, 2021

Choose a reason for hiding this comment

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

Great! Maybe we should use it in more tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the other functions (internal) are not client related functions
so it seems I can't use it on them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#146 (comment)

it seems the comment about the 'Depends(get_db)' encounters the same problem
the Depends is of no use if the function is not a router function.
I did not find a way to use it within a standard non-fastapi function

the internal functions are used by the routers functions which uses Depends

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I split the tests into two files: internal tests and route tests.

Tell me what you think about the rearrangement and my comments :)

massage = None
if mode == "add":
massage = "could not add The Weekly Task"
made_change = create_weekly_task(
Copy link
Member

@yammesicka yammesicka Feb 7, 2021

Choose a reason for hiding this comment

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

Deduplicate and move outside

Copy link
Contributor Author

Choose a reason for hiding this comment

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

different functions, in the next commits I will change the names and variables to make it clearer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed the names so it will be more clear, please look again, tell me what you think :)

weekly_task_id=weekly_task_id
)

made_change = False
Copy link
Member

@yammesicka yammesicka Feb 7, 2021

Choose a reason for hiding this comment

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

Remove

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed the names so it will be more clear, please look again, tell me what you think :)

Copy link
Member

Great work, but we still have a little way to go :)

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.

Great progress. I love the expansion of the tests.
I've added few insights, please take a look :)

Copy link
Contributor

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

content = Column(String)
is_done = Column(Boolean, nullable=False)
is_important = Column(Boolean, nullable=False)
date_time = Column(DateTime, nullable=False)
Copy link
Contributor

@IdanPelled IdanPelled Feb 24, 2021

Choose a reason for hiding this comment

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

Try to give more specific variable names.
is it the creation date, or maybe the deadline, it is hard to tell.

Copy link
Contributor Author

@issac211 issac211 Feb 24, 2021
edited
Loading

Choose a reason for hiding this comment

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

I should not mess with this model, its not mine

Comment on lines +39 to +44
day = day_full_name[:3]
day_lower = day.lower()
if day in days_list:
checked_days.append((day_full_name, day_lower, "checked"))
else:
checked_days.append((day_full_name, day_lower, ""))
Copy link
Contributor

@IdanPelled IdanPelled Feb 24, 2021

Choose a reason for hiding this comment

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

Split to functions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did not understand

)


@router.get("/add", dependencies=[Depends(is_logged_in)])
Copy link
Contributor

@IdanPelled IdanPelled Feb 24, 2021

Choose a reason for hiding this comment

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

Add is_logged_in to the router's dependencies instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I realized that the function is meant to be used in this way as well.
In case I do not need to use the variable it return's inside the router.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@yammesicka yammesicka yammesicka requested changes

+1 more reviewer

@IdanPelled IdanPelled IdanPelled left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /