-
Notifications
You must be signed in to change notification settings - Fork 2
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
Drobert fetch intra #48
Drobert fetch intra #48
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its an absolute masterpiece I like the coding style and overall it's a very well done job.
I left some comments among the most important things to review are:
- Encapsulation and advanced python concepts
- PEP8 naming conventions for Class attributes and Class instance attributes
- Review a little typo I found
all ==> filter
- Find out what response we get with 500 so we can handle it correctly
- Discuss inheritance, pros and cons, consider this possibility
We should schedule a meeting to discuss this amazing progress ;)
GL! Keep it up 🥂
Made the changes that you suggested. |
We should add to our wiki how the commands work, do you want to take over that? I can also do it, let me know 🗡️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work, I am glad to see that you've progressed so much, I think this will help you a lot for the future, and working with Python is always a nice experience.
We just need to polish 💅 everything and it will be good to merge! ⏫
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! It's looking very nice.
We can discuss how to setup cron with docker later ;D
So it can run daily or once every two days.
We want to mention this with Vitor, so we have clear objectives for the next evaluation.
Cheers, happy summer! 🏖️
This implements a command
sync_db
(with sub commands) which will fetch data from the 42 API and save it in our database.The subcommands are the following:
user
skill
project
cursus
relations
- Updates all the relations in the databaseall
- Runs the commands aboveThere is also a new module for fetching data from the 42 api. Its split into 2 classes (although the
AuthApi42
should not really be used at the user end):AuthApi42
&Api42
. Api42 is our interface for the user. This has a get command which will fetch data from the api using theGET
request method.The
models.py
file also got some improvements. Every model now has a__str__
&update
functions. For the models that already had a__str__
function, they have been updated to be a more uniform in style. The update function updates/creates a model based on json data (What we got from the api).Our command uses the
logging
(built-in) library. This will output to a logfile (unless told otherwise by the--no-logfile
option) and the console. The output can be changed using the (built-in)-v
option.This should hopefully resolve the following issue(s):