Skip to content

Conversation

@EliuX
Copy link
Contributor

@EliuX EliuX commented Mar 10, 2020

This PR creates an API definition to manage activities.

@EliuX EliuX force-pushed the feature/create-api-definition-activies#4 branch 2 times, most recently from 5145117 to 3716435 Compare March 10, 2020 21:29
return flask_app


def init_app(app):
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we use type hints here https://docs.python.org/3/library/typing.html ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, I will do it.

description="API for the TimeTracker project")

# APIs
from time_tracker_api.projects import projects_api
Copy link
Contributor

@Angeluz-07 Angeluz-07 Mar 10, 2020

Choose a reason for hiding this comment

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

Shouldn't we put all the imports at the top?

On the other hand, the import from time_tracker_api.projects import projects_api from what I understand, you import the file projects_api and use it to reference functions inside of it. But It took me some minutes to figure it out. I think it would more easy to grasp something like from time_tracker_api.projects.projects_api import ns as projects_ns. But feel free to argument your approach.

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 thing is that when I see the variable projects_ns it looks like an alias but it is not clear where it comes from, also it makes that import line bigger. When I see projects_api.ns, I understand that it comes from projects_api and that the variable it references is ns, there is no possible abstract interpretation.

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 the import in the same part where I added that namespace because it seemed a good idea to have them together in case I wanted to remove or comment the inclusion of a particular namespace.

@EliuX EliuX force-pushed the feature/create-api-definition-activies#4 branch from 3716435 to 6106970 Compare March 10, 2020 22:12
@EliuX EliuX force-pushed the feature/create-api-definition-activies#4 branch from 6106970 to d9bb604 Compare March 10, 2020 22:14
@EliuX EliuX merged commit e1224d2 into master Mar 10, 2020
@EliuX EliuX deleted the feature/create-api-definition-activies#4 branch March 10, 2020 22:17
@EliuX EliuX self-assigned this Apr 17, 2020
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