From cd5b2fd8a7740343846a1cd8916999b8fc69f28a Mon Sep 17 00:00:00 2001 From: "Jose E.R" Date: Fri, 30 Dec 2016 18:22:29 +0100 Subject: [PATCH] Update README with DR27_CONFIG setting. --- README.md | 172 ++++++++++++++++++++++++++++++++++------------------- README.rst | 22 +++++++ 2 files changed, 134 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index 2552db8..b2678df 100644 --- a/README.md +++ b/README.md @@ -1,98 +1,150 @@ -[![Build Status](https://travis-ci.org/SRJ9/django-driver27.svg?branch=develop)](https://travis-ci.org/SRJ9/django-driver27) +[![Build +Status](https://travis-ci.org/SRJ9/django-driver27.svg?branch=develop)](https://travis-ci.org/SRJ9/django-driver27) [![codecov](https://codecov.io/gh/SRJ9/django-driver27/branch/develop/graph/badge.svg)](https://codecov.io/gh/SRJ9/django-driver27) -[![Code Climate](https://codeclimate.com/github/SRJ9/django-driver27/badges/gpa.svg)](https://codeclimate.com/github/SRJ9/django-driver27) -[![Requirements Status](https://requires.io/github/SRJ9/django-driver27/requirements.svg?branch=develop)](https://requires.io/github/SRJ9/django-driver27/requirements/?branch=develop) +[![Code +Climate](https://codeclimate.com/github/SRJ9/django-driver27/badges/gpa.svg)](https://codeclimate.com/github/SRJ9/django-driver27) +[![Requirements +Status](https://requires.io/github/SRJ9/django-driver27/requirements.svg?branch=develop)](https://requires.io/github/SRJ9/django-driver27/requirements/?branch=develop) + +driver27 +======== -# driver27 Racing competition manager in Django where you can manage different motor competitions with its own punctuation rules, races, drivers, teams which, at the same time, can be part of multiple competitions. Modify your settings.py ======================= -``` -INSTALLED_APPS = [ - 'bootstrap3', -... - 'django_countries', - 'tabbed_admin', - 'driver27' -] + INSTALLED_APPS = [ + 'bootstrap3', + ... + 'django_countries', + 'tabbed_admin', + 'driver27' + ] + + + TABBED_ADMIN_USE_JQUERY_UI = True + +DR27\_CONFIG +============ + +Now, you can add more punctuation and record configs adding DR27\_CONFIG +in your settings.py. Follow this example : -TABBED_ADMIN_USE_JQUERY_UI = True -``` + DR27_DEMO = { + 'RECORDS': { + 'PODIUM-GATES': {'label': _('At the gates of podium'), 'filter': {'finish__exact': 4}}, + ... + }, + 'PUNCTUATION': { + 'DR27-POINTS': {'type': 'full', 'finish': [10, 5, 3, 1], 'fastest_lap': 0, 'label': 'DR27 points'}, + ... + } + } + +If you want to allow translate, add this import : + + from django.utils.translation import ugettext as _ Versions ======== -- 0.14c (Fernando Alonso 14) -- 0.16c (Road to Championship '16) -- 0.19 (Ayrton Senna's Toleman's car number '84 - Debut) -- 0.27-VIL (Gilles Villeneuve 27) + +- 0.14c (Fernando Alonso 14) +- 0.16c (Race to Championship '16) +- 0.19 (Ayrton Senna's Toleman's car number '84 - Debut) +- 0.27-VIL (Gilles Villeneuve 27) 0.19.1.1 ======== -- Team records by season (total, races with at least one and races with doubles) + +- Team records by season (total, races with at least one and races + with doubles) 0.19.1 ====== -- Add records by season + +- Records by season 0.19 ==== -- Spanish translation -- Link to copy season copying teams and races to add_view. Seats is potentially bugged by team dependency (both would be create at the same time). -- Fix bugs founded in previous versions. + +- Spanish translation +- Link to copy season copying teams and races to add\_view. Seats is + potentially bugged by team dependency (both would be create at the + same time). +- Fix bugs founded in previous versions. 0.16 ==== -- What would happen if the 10-point scoring system was used? Would the champion be the same? This version will give you the answer. -- Olympic rank: Alternative rank with the gold first method. The driver with superior race results (based on descending order, from number of wins to numbers of second-places down) will gain precedence. -- Road to championship: When the season goes down, we can calculate who would be the champion predicting the results in the last races. Olympic rank is counted in case of points tie. Rosberg or Hamilton? + +- What would happen if the 10-point scoring system was used? Would the + champion be the same? This version will give you the answer. +- Olympic rank: Alternative rank with the gold first method. The + driver with superior race results (based on descending order, from + number of wins to numbers of second-places down) will gain + precedence. +- Road to championship: When the season goes down, we can calculate + who would be the champion predicting the results in the last races. + Olympic rank is counted in case of points tie. Rosberg or Hamilton? 0.14 ==== -- Initial models -- Basic relation restriction with exceptions and tests -- Basic templates to frontend views -- Basic demo to test the app + +- Initial models +- Basic relation restriction with exceptions and tests +- Basic templates to frontend views +- Basic demo to test the app models -=========== -- Driver -- Team -- Circuit -- Grand Prix -- Competition -- Season -- Race -- Result -- Contender (Driver/Competition relation) -- Seat (Contender/Team relation) -- fixtures folder contains fixture of each model to demo project. - -Demo (virtualenv recomended) -=========================== -```bash +====== + +- Driver +- Team +- Circuit +- Grand Prix +- Competition +- Season +- Race +- Result +- Contender (Driver/Competition relation) +- Seat (Contender/Team relation) +- fixtures folder contains fixture of each model to demo project. + +Demo (virtualenv recommended) +============================= + +~~~~ {.sourceCode .bash} $ git clone https://github.com/SRJ9/django-driver27 $ cd django-driver27 # or name of destiny folder $ pip install -r requirements.txt $ python demo/manage.py runserver $ # login /admin: admin:pass -``` +~~~~ Todo ==== -- [x] Add records by season (driver, team) -- [ ] Add records by driver/team career -- [ ] Add records by competition -- [ ] Add drivers profile with records, last_wins, teams... -- [x] Add easy clone to Season -- [x] Translate -- [ ] 1980's punctuation. Only 11 best results. -- [ ] Old punctuation. Split season races, and get only 4 of each half. - -# History -Driver 27 is a reference to car number of Gilles Villeneuve, F1 Driver died in 1982. Gilles is considered one of best driver despite he never won the World Championship, something that Jacques Villeneuve, his son, did in 1998. - -In 1980's decade, F1 teams kept their numbers unless they were champions. This made Ferrari, the most legendary team of the F1, take that number for many years (1981-1995), making the number an icon of this sport. + +- [x] Add records by season (driver, team) +- [ ] Add records by driver/team career +- [ ] Add records by competition +- [ ] Add drivers profile with records, last\_wins, teams... +- [x] Add easy clone to Season +- [x] Translate +- [ ] 1980's punctuation. Only 11 best results. +- [ ] Old punctuation. Split season races, and get only 4 of each + half. + +History +======= + +Driver 27 is a reference to car number of Gilles Villeneuve, F1 Driver +died in 1982. Gilles is considered one of best driver despite he never +won the World Championship, something that Jacques Villeneuve, his son, +did in 1998. + +In 1980's decade, F1 teams kept their numbers unless they were +champions. This made Ferrari, the most legendary team of the F1, take +that number for many years (1981-1995), making the number an icon of +this sport. diff --git a/README.rst b/README.rst index e21ba8f..844203b 100644 --- a/README.rst +++ b/README.rst @@ -23,6 +23,28 @@ Modify your settings.py TABBED_ADMIN_USE_JQUERY_UI = True +DR27_CONFIG +=========== +Now, you can add more punctuation and record configs adding DR27_CONFIG in your settings.py. +Follow this example +:: + + DR27_DEMO = { + 'RECORDS': { + 'PODIUM-GATES': {'label': _('At the gates of podium'), 'filter': {'finish__exact': 4}}, + ... + }, + 'PUNCTUATION': { + 'DR27-POINTS': {'type': 'full', 'finish': [10, 5, 3, 1], 'fastest_lap': 0, 'label': 'DR27 points'}, + ... + } + } + +If you want to allow translate, add this import +:: + + from django.utils.translation import ugettext as _ + Versions ========