The Civil Rights Litigation Clearinghouse, a project of the University of Michigan Law School, is seeking a part-time, remote (within the U.S.) full-stack developer. For more information about the role, see the job posting.
The purpose of this coding task is to demonstrate your abilities with Python, Django, and dealing with database data. It's intended to take 1-2 hours.
To keep your submission private, you should create your own private repository that mirrors this one.
- Create a new GitHub repository. Make sure it's private (so that others can't copy your work).
- Create a bare clone of this repository:
$ git clone --bare https://github.com/CRLClearinghouse/dev_example.git
- Mirror-push to your new repository:
$ cd dev_example
$ git push --mirror https://github.com/your-username/your-new-repository.git
- Now remove your local directory for this repository, and clone your own repository:
$ cd ..
$ rm -r dev_example
$ git clone https://github.com/your-username/your-new-repository.git
- Finally, create a new branch for your changes:
$ cd your-new-repository
$ git checkout -b your-branch-name
Before starting on your changes, make sure you can run the server locally.
- Install the dependencies:
$ pip install -r requirements.txt
(Depending on your Python setup, you might need to use pip3
instead of pip
.)
- Download the Data:
$ wget https://www.dropbox.com/s/z9vnmd6vj8na45t/data.zip
(Or you can download it by visiting the Dropbox URL.) Once downloaded, you should also unzip the data:
$ unzip data.zip
- Run the server:
$ python manage.py server
(Depending on your Python setup, you might need to use python3
instead of python
.)
Test your connection by going to http://127.0.0.1:8000/ and look for the text "Clearinghouse app is running!"
One thing the Clearinghouse keeps track of is people who are involved in the litigation of cases, e.g. attorneys and judges. The goal of this is to import people data into this Django project.
In this repository is a bare-bones Django project. There is an app called clearinghouse
that already has two models: Court
and Person
. The data you downloaded includes an excerpt of data exported from three tables in the Clearinghouse: chCourts
, chPeople
, and chPeopleCourts
. You have three tasks:
- Import the first and last names of the entries in the
chPeople
table to the existingPerson
model. The only required fields arefirst_name
andlast_name
, but you may extend thePerson
model and add additional fields if doing so makes it easier to complete the remaining tasks. - Create a model named
PersonCourt
for the data inchPeopleCourts
. This data relates courts with judges in order to convey when a judge started working at a court. Some judges have worked at multiple courts. - Import the
chPeopleCourts
data into the model you created, preserving the appropriate relationships toPerson
andCourt
. You should ignore rows where thepersonId
does not match theid
of a row inchPeople.csv
. (Hint: In theCourt
model,ch_id
is the legacy court ID.)
You may use Google, Stack Overflow, Python/Django docs, etc. as resources. In addition, here are some potentially helpful links to Django documentation (you do not have to use these in your solution):
- Using
save()
to save Python objects into the database - Relationships between models:
- Running a Python shell
As mentioned above, we don't intend for you to spend more than 1-2 hours on this task, and would rather see a partial submission than have you spend longer than 2 hours working on this. Good luck!
- Create a pull request in your repository with the code you have written.
- In the description of the pull request, include the following information:
- The counts of
Court
,Person
, andPersonCourt
entries that display when looking at http://127.0.0.1:8000/. - Any testing of your code.
- Any explanation of design choices you think need explanation.
- The counts of
- From your repository's page, under Settings > Manage Access, add MargoSchlanger and laurenyu as collaborators so that we can see your submission.
- Notify us by emailing mschlan [at] umich [dot] edu.