Task
- We need a stat counter to track the number of files uploaded via the tool. We can show that later on the screen ? We can implement this as part of a logging system in the database.
- I am thinking of a stat table to look like this. We do not really want to store the upload file on our database anyway:
id: counter username: Wikimedia username number_of_files: Number of files uploaded created_at: datetime of the time of event
- Lets save it once an upload goes through. You can read more about django models and creating objects at: https://docs.djangoproject.com/en/3.0/ref/models/instances/#creating-objects
Required skills
python-django, python, some js
Setup Guide for GCI students
You have to setup the python-django tool Gdrive to Commons locally to start with contributing. You can read how to setup the tool on your machine here.
We host our code on Github, so the change should come in as a pull request to https://github.com/tonythomas01/gdrive_to_commons. Steps to contribute are similar to Pull request workflow. Or, you can rely on the following:
- Create a local fork of https://github.com/tonythomas01/gdrive_to_commons using your account.
- Create a branch with the phabricator task name from origin/master. For eg, git checkout -b T55445 origin/master. Make sure to update your local branch by git pull --rebase or whatever necessary before creating a branch.
- Fix the issue you are solving.
- Commit it (git commit -m "What you fixed goes here")
- Push it to your Github fork of the repo (git push -u origin HEAD)
- Later, create a pull request to https://github.com/tonythomas01/gdrive_to_commons from Github with your changes.
- Would be pretty cool if you also paste your pull request link on your phabricator task so people know that things are moving.
