diff --git a/README.md b/README.md index fa1e4d8..f99d629 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,105 @@ +# Django technical test / Backend (English version first, French version below) + +The objective of the exercise below is to model a database based on business specifications and to +design a simple interface for managing bus routes, using Django admin. + +To carry out the test, remember to fork this repository. Ideally, open a PR at the end. + +## Evaluation criteria + +- Code documentation and clarity +- Database modeling +- Django framework mastery + +## Technical stack + +| Name | Version | +| ------ | ------- | +| Python | 3.9 | +| Django | 4.2.16 | + +- This project was created using Python 3.7. You are free to use another version, but this is the one we recommend. +recommended. +- The database is freely selectable. The project is configured to use `sqlite` by default. + +### Start the project + +*From your Python 3.7 virtualenv*: + +``` +make install +make migrate +make run +``` + +Scripts are available to help you quickly create data and take control of the project. +in hand: + +- `create_data` +- `create_buses` +- `create_drivers` +- `create_places` +- `create_users` + +For example: + +``` +python manage.py create_drivers -n 5 +``` + +## Subject + +### Description + +A bus trip (`BusShift`) is composed of the following elements: + +- A bus: (`Bus`). +- A driver: (`Driver`). +- Between 2 and an infinite number of stops (`BusStop`). +- Departure time is determined by the time at the first stop. +- The arrival time is determined by the time at the last stop. +- The total time required to complete the journey from the departure time to the arrival time can be deducted. + +The proposed project structure already includes the following models: +- Bus +- Driver +- Place +- User` (extends Django's [AbstractUser] model (https://docs.djangoproject.com/en/3.2/topics/auth/customizing/#substituting-a-custom-user-model)) + +### Objectives + +#### Implement the `BusShift` and `BusStop` models in the existing code base + +The implementation of these two models is up to you. The following business constraints +must be respected: + +- The same bus cannot be assigned to several routes at the same time, with overlapping start and end times. +overlap. +- The same applies to drivers. + +#### Provide an interface for managing bus routes + +It must be possible for a user to create or modify bus routes (`BusShift`) using django's admin +interface. + +**Note**: There are several ways of designing this functionality. Some may be more time-consuming +more time-consuming than others... + + + +### Tips + +- Don't spend more than 4 hours on a subject (the aim is to evaluate your skills, not to reduce your free time to nothing ;-)) +- Focus on quality and best practices. +- You can reduce the scope of the project if you're short of time. A draft response is already a good thing. +- Be ready to present the subject, justify your choices and talk about how you would have done the parts you left out. + + + + + + + # Test technique Django / Backend L'objectif de l'exercice ci-dessous est de modéliser une base de données à partir de spécifications métiers et de