first commit to Fred.

This commit is contained in:
Trullemans Gregory 2020-02-17 15:52:31 +01:00
commit fcbdc0b952
360 changed files with 99196 additions and 0 deletions

134
.gitignore vendored Normal file
View File

@ -0,0 +1,134 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/

33
CHANGELOG Normal file
View File

@ -0,0 +1,33 @@
Code couvert par Black & Flake8
DB sur MySQL 8.0.19 Community Edition
Sulley@Maxidingue src % brew install mysql-client
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
iam-policy-json-to-terraform raxml-ng
==> Updated Formulae
protobuf ✔ balena-cli certbot fetch-crl ldc pandoc procs zsh
angle-grinder bison cheat file-roller mutt percona-toolkit vim
awscli@1 broot docker imagemagick pacapt phpstan youtube-dl
==> Downloading https://homebrew.bintray.com/bottles/mysql-client-8.0.18.catalina.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/6a/6aeb496213d40f45bc44123703753012ea889468b7f37101a42772da237ab4ad?__gda__=exp=1581923752~hmac=c497712b4
######################################################################## 100.0%
==> Pouring mysql-client-8.0.18.catalina.bottle.tar.gz
==> Caveats
mysql-client is keg-only, which means it was not symlinked into /usr/local,
because it conflicts with mysql (which contains client libraries).
If you need to have mysql-client first in your PATH run:
echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.zshrc
For compilers to find mysql-client you may need to set:
export LDFLAGS="-L/usr/local/opt/mysql-client/lib"
export CPPFLAGS="-I/usr/local/opt/mysql-client/include"
==> Summary
🍺 /usr/local/Cellar/mysql-client/8.0.18: 127 files, 137.6MB
==> `brew cleanup` has not been run in 30 days, running now...
Removing: /Users/Sulley/Library/Caches/Homebrew/protobuf--3.11.3.catalina.bottle.tar.gz... (4.8MB)

1
LICENSE Normal file
View File

@ -0,0 +1 @@
LICENSE

5
README.md Normal file
View File

@ -0,0 +1,5 @@
# Gestion de Gymnastes
Le but de cette application est de permettre une gestion des gymnastes tout au long de leur carrière : de leur premier cours à leur ultime compétition.
(plus d'information à venir)

View File

@ -0,0 +1,94 @@
-- phpMyAdmin SQL Dump
-- version 4.4.12
-- http://www.phpmyadmin.net
--
-- Client : localhost
-- Généré le : Mer 18 Juillet 2018 à 14:32
-- Version du serveur : 5.6.26
-- Version de PHP : 7.1.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de données : `ffg_judging`
--
-- --------------------------------------------------------
--
-- Structure de la table `competition_availablecategory`
--
CREATE TABLE IF NOT EXISTS `competition_availablecategory` (
`id` int(11) NOT NULL,
`is_active` tinyint(1) NOT NULL,
`category_id` int(11) DEFAULT NULL,
`division_id` int(11) DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8;
--
-- Contenu de la table `competition_availablecategory`
--
INSERT INTO `competition_availablecategory` (`id`, `is_active`, `category_id`, `division_id`) VALUES
(1, 1, 1, 5),
(2, 1, 2, 5),
(3, 1, 3, 5),
(4, 1, 4, 1),
(5, 1, 5, 1),
(6, 1, 6, 1),
(7, 1, 7, 1),
(8, 1, 8, 1),
(9, 1, 4, 2),
(10, 1, 5, 2),
(11, 1, 6, 2),
(12, 1, 7, 2),
(13, 1, 8, 2),
(14, 1, 9, 3),
(15, 1, 10, 3),
(16, 1, 11, 3),
(17, 1, 12, 3),
(18, 1, 13, 4);
--
-- Index pour les tables exportées
--
--
-- Index pour la table `competition_availablecategory`
--
ALTER TABLE `competition_availablecategory`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `competition_availablecat_division_id_category_id_7cbea8cc_uniq` (`division_id`,`category_id`),
ADD KEY `competition_availabl_category_id_d9b4ab8c_fk_competiti` (`category_id`);
--
-- AUTO_INCREMENT pour les tables exportées
--
--
-- AUTO_INCREMENT pour la table `competition_availablecategory`
--
ALTER TABLE `competition_availablecategory`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=19;
--
-- Contraintes pour les tables exportées
--
--
-- Contraintes pour la table `competition_availablecategory`
--
ALTER TABLE `competition_availablecategory`
ADD CONSTRAINT `competition_availabl_category_id_d9b4ab8c_fk_competiti` FOREIGN KEY (`category_id`) REFERENCES `competition_category` (`id`),
ADD CONSTRAINT `competition_availabl_division_id_88e96c01_fk_competiti` FOREIGN KEY (`division_id`) REFERENCES `competition_division` (`id`);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

View File

@ -0,0 +1,76 @@
-- phpMyAdmin SQL Dump
-- version 4.4.12
-- http://www.phpmyadmin.net
--
-- Client : localhost
-- Généré le : Mer 18 Juillet 2018 à 14:31
-- Version du serveur : 5.6.26
-- Version de PHP : 7.1.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de données : `ffg_judging`
--
-- --------------------------------------------------------
--
-- Structure de la table `competition_category`
--
CREATE TABLE IF NOT EXISTS `competition_category` (
`id` int(11) NOT NULL,
`label` varchar(25) NOT NULL,
`acronym` varchar(7) NOT NULL,
`is_active` tinyint(1) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
--
-- Contenu de la table `competition_category`
--
INSERT INTO `competition_category` (`id`, `label`, `acronym`, `is_active`) VALUES
(1, '-8 ans', '-8', 1),
(2, '-9 ans', '-9', 1),
(3, '-10 ans', '-10', 1),
(4, '11 ans', '11', 1),
(5, '12 ans', '12', 1),
(6, '13-14 ans', '13-14', 1),
(7, 'Juniors', 'Ju', 1),
(8, 'Seniors', 'Se', 1),
(9, 'Niveau 1', 'N1', 1),
(10, 'Niveau 2', 'N2', 1),
(11, 'Niveau 3', 'N3', 1),
(12, 'Niveau 4', 'N4', 1),
(13, 'Bronze', 'Bronze', 1);
--
-- Index pour les tables exportées
--
--
-- Index pour la table `competition_category`
--
ALTER TABLE `competition_category`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT pour les tables exportées
--
--
-- AUTO_INCREMENT pour la table `competition_category`
--
ALTER TABLE `competition_category`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=14;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

View File

@ -0,0 +1,62 @@
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de données : `ffg_judging`
--
-- --------------------------------------------------------
--
-- Structure de la table `competition_division`
--
CREATE TABLE IF NOT EXISTS `competition_division` (
`id` int(11) NOT NULL,
`label` varchar(25) NOT NULL,
`acronym` varchar(5) NOT NULL,
`is_active` tinyint(1) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
--
-- Contenu de la table `competition_division`
--
INSERT INTO `competition_division` (`id`, `label`, `acronym`, `is_active`) VALUES
(1, 'Division 1', 'D1', 1),
(2, 'Division 2', 'D2', 1),
(3, 'Division 3', 'D3', 1),
(4, 'Division 4', 'D4', 1),
(5, 'Division Préparatoire', 'Prépa', 1);
--
-- Index pour les tables exportées
--
--
-- Index pour la table `competition_division`
--
ALTER TABLE `competition_division`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT pour les tables exportées
--
--
-- AUTO_INCREMENT pour la table `competition_division`
--
ALTER TABLE `competition_division`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=6;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

1004
backup_database/khana.sql Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,66 @@
"1","Delginiesse","Lou","Acrotramp Blocry","2007-05-30","F","121510","1","64","17"
"2","Delginiesse","Léa","Acrotramp Blocry","2004-04-01","F","121509","1","24","17"
"3","Gatelier","Léa","Acrotramp Blocry","2005-09-22","F","141305","1","51","17"
"4","Henry","Océane","Acrotramp Blocry","2003-05-26","F","99539","1","20","17"
"5","Herlant","Pénéline","Acrotramp Blocry","2006-08-30","F","122578","1","40","17"
"6","Reynaert","Sara","Acrotramp Blocry","2006-02-22","F","122573","1","61","17"
"7","Trejo","Metzli","Acrotramp Blocry","2004-06-17","F","141308","1","18","17"
"8","Beauclercq","Nathan","Acrotramp Blocry","2005-01-22","M","141301","1","17","17"
"9","De Mesmaeker","Adrien","Acrotramp Blocry","2004-04-09","M","122585","1","33","17"
"10","Detalle","Mattéo","Acrotramp Blocry","2006-10-25","M","122588","1","26","17"
"11","Garcia Moreau","Matéo","Acrotramp Blocry","2005-08-24","M","99555","1","37","17"
"12","Jarman","Joshua","Acrotramp Blocry","2006-01-10","M","141315","1","11","17"
"13","Pablos Martin","Hugo","Acrotramp Blocry","2004-08-12","M","141313","1","34","17"
"14","Van Poucke Cotton","Nelson","Acrotramp Blocry","2007-01-23","M","141306","1","57","17"
"15","Vanhuffel","Trystan","Acrotramp Blocry","2005-04-03","M","141303","1","21","17"
"16","Ingels","Cedric","CGOM ASBL","2007-06-08","M","82832","1","44","17"
"17","Charles","Angelique","Acrotramp Blocry","1992-08-10","F","10900","1","5","16"
"18","Leblanc","Olivia","Acrotramp Blocry","2000-12-19","F","112449","1","59","16"
"19","Luyten","Clara","Acrotramp Blocry","2003-07-23","F","112450","1","56","16"
"20","Tombeux","Juliette","Acrotramp Blocry","2005-12-28","F","99545","1","14","16"
"21","Eglem","Elisa","Aquilon Lillois","2005-02-24","F","133827","1","27","16"
"22","Geirnaert","Marine","Aquilon Lillois","2002-11-12","F","74759","1","13","16"
"23","Kraled","Anyssa","Aquilon Lillois","2004-10-18","F","96489","1","1","16"
"24","Catteau","Marine","CGOM ASBL","2004-02-05","F","135223","1","36","16"
"25","Gaeremynck","Laurine","CGOM ASBL","2002-03-01","F","10012","1","31","16"
"26","Ernaelsten","Perrine","TRAMPO NAMUR CLUB","2004-12-09","F","54365","1","4","16"
"27","Brodzinski","Barthélemy","Acrotramp Blocry","2002-06-24","M","58261","1","49","16"
"28","Goens","François","Acrotramp Blocry","2001-08-27","M","141309","1","29","16"
"29","Le Grelle","Jérémie","Acrotramp Blocry","2000-10-24","M","96217","1","39","16"
"30","Simon","Matthias","Acrotramp Blocry","2003-02-24","M","122574","1","60","16"
"31","Devos","Hugo","CGOM ASBL","2006-05-22","M","133688","1","28","16"
"32","Dhulst","Louis","CGOM ASBL","2006-09-27","M","127026","1","54","16"
"33","Jeunehomme","Nathan","TRAMPO NAMUR CLUB","2003-03-05","M","126730","1","23","16"
"34","Breugelmans","Baptiste","Acrotramp Blocry","2002-10-21","M","122559","1","53","15"
"35","Huwaerts","Leslie","Acrotramp Blocry","2001-12-08","F","71725","1","48","15"
"36","Gheysens","Julie","CGOM ASBL","2005-06-01","F","42242","1","2","15"
"37","Herpoel","Cyrielle","CGOM ASBL","2005-10-28","F","69829","1","43","15"
"38","Platteau Holvoet","Raphael","CGOM ASBL","2005-02-25","M","120509","1","45","15"
"39","Roussel","Leina","CGOM ASBL","2004-03-17","F","80890","1","3","18"
"40","Vanbiervliet","Zoë","CGOM ASBL","2000-12-11","F","10216","1","47","14"
"41","Vandenberghe","Zélie","CGOM ASBL","2003-08-07","F","42230","1","41","14"
"42","Jacquet","Quentin","Acrotramp Blocry","2004-10-19","M","99547","1","66","14"
"43","Moens","Aymeric","Acrotramp Blocry","2001-02-26","M","58294","1","65","12"
"44","Debusschere","Tom","CGOM ASBL","2003-02-11","M","91937","1","8","14"
"45","Jaillet","Robin","CGOM ASBL","2001-06-29","M","97949","1","25","14"
"46","Scokart","Romain","Flying Acrobatics Trampoline Club","2001-12-30","M","103263","1","42","14"
"47","Herlant","Ophéliane","Acrotramp Blocry","2008-11-03","F","122577","1","15","3"
"48","Lannoye","Cédric","Acrotramp Blocry","2008-06-30","M","141316","1","38","3"
"49","May","boris","Acrotramp Blocry","2008-06-17","M","144052","1","12","3"
"50","Mean","Juliette","Acrotramp Blocry","2008-02-05","F","54451","1","35","3"
"51","Reynart","Flore","Acrotramp Blocry","2008-07-15","F","141297","1","46","3"
"52","Romain","Mathis","Acrotramp Blocry","2008-02-28","M","141307","1","50","3"
"53","Cordier","Jeanne","Acrotramp Blocry","2010-01-10","F","144055","1","58","2"
"54","Demaret","Louise","Acrotramp Blocry","2009-09-27","F","96169","1","6","2"
"55","Ebertitan","Kenza","Acrotramp Blocry","2009-06-26","F","141304","1","55","2"
"56","Halin","Axel","Acrotramp Blocry","2009-02-13","M","141310","1","9","2"
"57","Renette","Zebulon","Acrotramp Blocry","2009-02-14","M","141317","1","63","2"
"58","Mertens","Déborah","Flying Acrobatics Trampoline Club","2009-11-04","F","119801","1","16","2"
"59","Salhi","Safwane","Flying Acrobatics Trampoline Club","2001-05-30","M","4283","1","30","7"
"60","Pesesse","Lucas","Flying Acrobatics Trampoline Club","2007-07-19","M","70414","1","32","4"
"61","Carlini","Gabriel","Flying Acrobatics Trampoline Club","2006-08-11","M","103673","1","22","5"
"62","Demacker","Naomy","CGOM ASBL","2004-04-14","F","123439","1","10","11"
"63","Damri","Neila","TRAMPO NAMUR CLUB","2004-06-14","F","25026","1","62","11"
"64","Granda Martinez","Noelia","Flying Acrobatics Trampoline Club","2003-01-28","F","66196","1","52","12"
"65","Vanholder","Noah","Flying Acrobatics Trampoline Club","2003-05-21","M","101994","1","7","12"
"66","Pirson","Maxime","TRAMPO NAMUR CLUB","2000-11-08","M","24332","1","19","13"
1 1 Delginiesse Lou Acrotramp Blocry 2007-05-30 F 121510 1 64 17
2 2 Delginiesse Léa Acrotramp Blocry 2004-04-01 F 121509 1 24 17
3 3 Gatelier Léa Acrotramp Blocry 2005-09-22 F 141305 1 51 17
4 4 Henry Océane Acrotramp Blocry 2003-05-26 F 99539 1 20 17
5 5 Herlant Pénéline Acrotramp Blocry 2006-08-30 F 122578 1 40 17
6 6 Reynaert Sara Acrotramp Blocry 2006-02-22 F 122573 1 61 17
7 7 Trejo Metzli Acrotramp Blocry 2004-06-17 F 141308 1 18 17
8 8 Beauclercq Nathan Acrotramp Blocry 2005-01-22 M 141301 1 17 17
9 9 De Mesmaeker Adrien Acrotramp Blocry 2004-04-09 M 122585 1 33 17
10 10 Detalle Mattéo Acrotramp Blocry 2006-10-25 M 122588 1 26 17
11 11 Garcia Moreau Matéo Acrotramp Blocry 2005-08-24 M 99555 1 37 17
12 12 Jarman Joshua Acrotramp Blocry 2006-01-10 M 141315 1 11 17
13 13 Pablos Martin Hugo Acrotramp Blocry 2004-08-12 M 141313 1 34 17
14 14 Van Poucke Cotton Nelson Acrotramp Blocry 2007-01-23 M 141306 1 57 17
15 15 Vanhuffel Trystan Acrotramp Blocry 2005-04-03 M 141303 1 21 17
16 16 Ingels Cedric CGOM ASBL 2007-06-08 M 82832 1 44 17
17 17 Charles Angelique Acrotramp Blocry 1992-08-10 F 10900 1 5 16
18 18 Leblanc Olivia Acrotramp Blocry 2000-12-19 F 112449 1 59 16
19 19 Luyten Clara Acrotramp Blocry 2003-07-23 F 112450 1 56 16
20 20 Tombeux Juliette Acrotramp Blocry 2005-12-28 F 99545 1 14 16
21 21 Eglem Elisa Aquilon Lillois 2005-02-24 F 133827 1 27 16
22 22 Geirnaert Marine Aquilon Lillois 2002-11-12 F 74759 1 13 16
23 23 Kraled Anyssa Aquilon Lillois 2004-10-18 F 96489 1 1 16
24 24 Catteau Marine CGOM ASBL 2004-02-05 F 135223 1 36 16
25 25 Gaeremynck Laurine CGOM ASBL 2002-03-01 F 10012 1 31 16
26 26 Ernaelsten Perrine TRAMPO NAMUR CLUB 2004-12-09 F 54365 1 4 16
27 27 Brodzinski Barthélemy Acrotramp Blocry 2002-06-24 M 58261 1 49 16
28 28 Goens François Acrotramp Blocry 2001-08-27 M 141309 1 29 16
29 29 Le Grelle Jérémie Acrotramp Blocry 2000-10-24 M 96217 1 39 16
30 30 Simon Matthias Acrotramp Blocry 2003-02-24 M 122574 1 60 16
31 31 Devos Hugo CGOM ASBL 2006-05-22 M 133688 1 28 16
32 32 Dhulst Louis CGOM ASBL 2006-09-27 M 127026 1 54 16
33 33 Jeunehomme Nathan TRAMPO NAMUR CLUB 2003-03-05 M 126730 1 23 16
34 34 Breugelmans Baptiste Acrotramp Blocry 2002-10-21 M 122559 1 53 15
35 35 Huwaerts Leslie Acrotramp Blocry 2001-12-08 F 71725 1 48 15
36 36 Gheysens Julie CGOM ASBL 2005-06-01 F 42242 1 2 15
37 37 Herpoel Cyrielle CGOM ASBL 2005-10-28 F 69829 1 43 15
38 38 Platteau Holvoet Raphael CGOM ASBL 2005-02-25 M 120509 1 45 15
39 39 Roussel Leina CGOM ASBL 2004-03-17 F 80890 1 3 18
40 40 Vanbiervliet Zoë CGOM ASBL 2000-12-11 F 10216 1 47 14
41 41 Vandenberghe Zélie CGOM ASBL 2003-08-07 F 42230 1 41 14
42 42 Jacquet Quentin Acrotramp Blocry 2004-10-19 M 99547 1 66 14
43 43 Moens Aymeric Acrotramp Blocry 2001-02-26 M 58294 1 65 12
44 44 Debusschere Tom CGOM ASBL 2003-02-11 M 91937 1 8 14
45 45 Jaillet Robin CGOM ASBL 2001-06-29 M 97949 1 25 14
46 46 Scokart Romain Flying Acrobatics Trampoline Club 2001-12-30 M 103263 1 42 14
47 47 Herlant Ophéliane Acrotramp Blocry 2008-11-03 F 122577 1 15 3
48 48 Lannoye Cédric Acrotramp Blocry 2008-06-30 M 141316 1 38 3
49 49 May boris Acrotramp Blocry 2008-06-17 M 144052 1 12 3
50 50 Mean Juliette Acrotramp Blocry 2008-02-05 F 54451 1 35 3
51 51 Reynart Flore Acrotramp Blocry 2008-07-15 F 141297 1 46 3
52 52 Romain Mathis Acrotramp Blocry 2008-02-28 M 141307 1 50 3
53 53 Cordier Jeanne Acrotramp Blocry 2010-01-10 F 144055 1 58 2
54 54 Demaret Louise Acrotramp Blocry 2009-09-27 F 96169 1 6 2
55 55 Ebertitan Kenza Acrotramp Blocry 2009-06-26 F 141304 1 55 2
56 56 Halin Axel Acrotramp Blocry 2009-02-13 M 141310 1 9 2
57 57 Renette Zebulon Acrotramp Blocry 2009-02-14 M 141317 1 63 2
58 58 Mertens Déborah Flying Acrobatics Trampoline Club 2009-11-04 F 119801 1 16 2
59 59 Salhi Safwane Flying Acrobatics Trampoline Club 2001-05-30 M 4283 1 30 7
60 60 Pesesse Lucas Flying Acrobatics Trampoline Club 2007-07-19 M 70414 1 32 4
61 61 Carlini Gabriel Flying Acrobatics Trampoline Club 2006-08-11 M 103673 1 22 5
62 62 Demacker Naomy CGOM ASBL 2004-04-14 F 123439 1 10 11
63 63 Damri Neila TRAMPO NAMUR CLUB 2004-06-14 F 25026 1 62 11
64 64 Granda Martinez Noelia Flying Acrobatics Trampoline Club 2003-01-28 F 66196 1 52 12
65 65 Vanholder Noah Flying Acrobatics Trampoline Club 2003-05-21 M 101994 1 7 12
66 66 Pirson Maxime TRAMPO NAMUR CLUB 2000-11-08 M 24332 1 19 13

View File

@ -0,0 +1,146 @@
-- phpMyAdmin SQL Dump
-- version 4.4.12
-- http://www.phpmyadmin.net
--
-- Client : localhost
-- Généré le : Mar 24 Juillet 2018 à 21:42
-- Version du serveur : 5.6.26
-- Version de PHP : 7.1.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de données : `ffg_judging`
--
-- --------------------------------------------------------
--
-- Structure de la table `person_gymnast`
--
CREATE TABLE IF NOT EXISTS `person_gymnast` (
`id` int(11) NOT NULL,
`lastname` varchar(255) NOT NULL,
`firstname` varchar(255) NOT NULL,
`club` varchar(255) NOT NULL,
`birthdate` date NOT NULL,
`gender` varchar(1) NOT NULL,
`licence` int(11) DEFAULT NULL,
`is_present` tinyint(1) NOT NULL,
`bib` int(11) DEFAULT NULL,
`category_id` int(11) DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=67 DEFAULT CHARSET=utf8;
--
-- Contenu de la table `person_gymnast`
--
INSERT INTO `person_gymnast` (`id`, `lastname`, `firstname`, `club`, `birthdate`, `gender`, `licence`, `is_present`, `bib`, `category_id`) VALUES
(1, 'Delginiesse', 'Lou', 'Acrotramp Blocry', '2007-05-30', 'F', 121510, 1, 64, 17),
(2, 'Delginiesse', 'Léa', 'Acrotramp Blocry', '2004-04-01', 'F', 121509, 1, 24, 17),
(3, 'Gatelier', 'Léa', 'Acrotramp Blocry', '2005-09-22', 'F', 141305, 1, 51, 17),
(4, 'Henry', 'Océane', 'Acrotramp Blocry', '2003-05-26', 'F', 99539, 1, 20, 17),
(5, 'Herlant', 'Pénéline', 'Acrotramp Blocry', '2006-08-30', 'F', 122578, 1, 40, 17),
(6, 'Reynaert', 'Sara', 'Acrotramp Blocry', '2006-02-22', 'F', 122573, 1, 61, 17),
(7, 'Trejo', 'Metzli', 'Acrotramp Blocry', '2004-06-17', 'F', 141308, 1, 18, 17),
(8, 'Beauclercq', 'Nathan', 'Acrotramp Blocry', '2005-01-22', 'M', 141301, 1, 17, 17),
(9, 'De Mesmaeker', 'Adrien', 'Acrotramp Blocry', '2004-04-09', 'M', 122585, 1, 33, 17),
(10, 'Detalle', 'Mattéo', 'Acrotramp Blocry', '2006-10-25', 'M', 122588, 1, 26, 17),
(11, 'Garcia Moreau', 'Matéo', 'Acrotramp Blocry', '2005-08-24', 'M', 99555, 1, 37, 17),
(12, 'Jarman', 'Joshua', 'Acrotramp Blocry', '2006-01-10', 'M', 141315, 1, 11, 17),
(13, 'Pablos Martin', 'Hugo', 'Acrotramp Blocry', '2004-08-12', 'M', 141313, 1, 34, 17),
(14, 'Van Poucke Cotton', 'Nelson', 'Acrotramp Blocry', '2007-01-23', 'M', 141306, 1, 57, 17),
(15, 'Vanhuffel', 'Trystan', 'Acrotramp Blocry', '2005-04-03', 'M', 141303, 1, 21, 17),
(16, 'Ingels', 'Cedric', 'CGOM ASBL', '2007-06-08', 'M', 82832, 1, 44, 17),
(17, 'Charles', 'Angelique', 'Acrotramp Blocry', '1992-08-10', 'F', 10900, 1, 5, 16),
(18, 'Leblanc', 'Olivia', 'Acrotramp Blocry', '2000-12-19', 'F', 112449, 1, 59, 16),
(19, 'Luyten', 'Clara', 'Acrotramp Blocry', '2003-07-23', 'F', 112450, 1, 56, 16),
(20, 'Tombeux', 'Juliette', 'Acrotramp Blocry', '2005-12-28', 'F', 99545, 1, 14, 16),
(21, 'Eglem', 'Elisa', 'Aquilon Lillois', '2005-02-24', 'F', 133827, 1, 27, 16),
(22, 'Geirnaert', 'Marine', 'Aquilon Lillois', '2002-11-12', 'F', 74759, 1, 13, 16),
(23, 'Kraled', 'Anyssa', 'Aquilon Lillois', '2004-10-18', 'F', 96489, 1, 1, 16),
(24, 'Catteau', 'Marine', 'CGOM ASBL', '2004-02-05', 'F', 135223, 1, 36, 16),
(25, 'Gaeremynck', 'Laurine', 'CGOM ASBL', '2002-03-01', 'F', 10012, 1, 31, 16),
(26, 'Ernaelsten', 'Perrine', 'TRAMPO NAMUR CLUB', '2004-12-09', 'F', 54365, 1, 4, 16),
(27, 'Brodzinski', 'Barthélemy', 'Acrotramp Blocry', '2002-06-24', 'M', 58261, 1, 49, 16),
(28, 'Goens', 'François', 'Acrotramp Blocry', '2001-08-27', 'M', 141309, 1, 29, 16),
(29, 'Le Grelle', 'Jérémie', 'Acrotramp Blocry', '2000-10-24', 'M', 96217, 1, 39, 16),
(30, 'Simon', 'Matthias', 'Acrotramp Blocry', '2003-02-24', 'M', 122574, 1, 60, 16),
(31, 'Devos', 'Hugo', 'CGOM ASBL', '2006-05-22', 'M', 133688, 1, 28, 16),
(32, 'Dhulst', 'Louis', 'CGOM ASBL', '2006-09-27', 'M', 127026, 1, 54, 16),
(33, 'Jeunehomme', 'Nathan', 'TRAMPO NAMUR CLUB', '2003-03-05', 'M', 126730, 1, 23, 16),
(34, 'Breugelmans', 'Baptiste', 'Acrotramp Blocry', '2002-10-21', 'M', 122559, 1, 53, 15),
(35, 'Huwaerts', 'Leslie', 'Acrotramp Blocry', '2001-12-08', 'F', 71725, 1, 48, 15),
(36, 'Gheysens', 'Julie', 'CGOM ASBL', '2005-06-01', 'F', 42242, 1, 2, 15),
(37, 'Herpoel', 'Cyrielle', 'CGOM ASBL', '2005-10-28', 'F', 69829, 1, 43, 15),
(38, 'Platteau Holvoet', 'Raphael', 'CGOM ASBL', '2005-02-25', 'M', 120509, 1, 45, 15),
(39, 'Roussel', 'Leina', 'CGOM ASBL', '2004-03-17', 'F', 80890, 1, 3, 18),
(40, 'Vanbiervliet', 'Zoë', 'CGOM ASBL', '2000-12-11', 'F', 10216, 1, 47, 14),
(41, 'Vandenberghe', 'Zélie', 'CGOM ASBL', '2003-08-07', 'F', 42230, 1, 41, 14),
(42, 'Jacquet', 'Quentin', 'Acrotramp Blocry', '2004-10-19', 'M', 99547, 1, 66, 14),
(43, 'Moens', 'Aymeric', 'Acrotramp Blocry', '2001-02-26', 'M', 58294, 1, 65, 12),
(44, 'Debusschere', 'Tom', 'CGOM ASBL', '2003-02-11', 'M', 91937, 1, 8, 14),
(45, 'Jaillet', 'Robin', 'CGOM ASBL', '2001-06-29', 'M', 97949, 1, 25, 14),
(46, 'Scokart', 'Romain', 'Flying Acrobatics Trampoline Club', '2001-12-30', 'M', 103263, 1, 42, 14),
(47, 'Herlant', 'Ophéliane', 'Acrotramp Blocry', '2008-11-03', 'F', 122577, 1, 15, 3),
(48, 'Lannoye', 'Cédric', 'Acrotramp Blocry', '2008-06-30', 'M', 141316, 1, 38, 3),
(49, 'May', 'boris', 'Acrotramp Blocry', '2008-06-17', 'M', 144052, 1, 12, 3),
(50, 'Mean', 'Juliette', 'Acrotramp Blocry', '2008-02-05', 'F', 54451, 1, 35, 3),
(51, 'Reynart', 'Flore', 'Acrotramp Blocry', '2008-07-15', 'F', 141297, 1, 46, 3),
(52, 'Romain', 'Mathis', 'Acrotramp Blocry', '2008-02-28', 'M', 141307, 1, 50, 3),
(53, 'Cordier', 'Jeanne', 'Acrotramp Blocry', '2010-01-10', 'F', 144055, 1, 58, 2),
(54, 'Demaret', 'Louise', 'Acrotramp Blocry', '2009-09-27', 'F', 96169, 1, 6, 2),
(55, 'Ebertitan', 'Kenza', 'Acrotramp Blocry', '2009-06-26', 'F', 141304, 1, 55, 2),
(56, 'Halin', 'Axel', 'Acrotramp Blocry', '2009-02-13', 'M', 141310, 1, 9, 2),
(57, 'Renette', 'Zebulon', 'Acrotramp Blocry', '2009-02-14', 'M', 141317, 1, 63, 2),
(58, 'Mertens', 'Déborah', 'Flying Acrobatics Trampoline Club', '2009-11-04', 'F', 119801, 1, 16, 2),
(59, 'Salhi', 'Safwane', 'Flying Acrobatics Trampoline Club', '2001-05-30', 'M', 4283, 1, 30, 7),
(60, 'Pesesse', 'Lucas', 'Flying Acrobatics Trampoline Club', '2007-07-19', 'M', 70414, 1, 32, 4),
(61, 'Carlini', 'Gabriel', 'Flying Acrobatics Trampoline Club', '2006-08-11', 'M', 103673, 1, 22, 5),
(62, 'Demacker', 'Naomy', 'CGOM ASBL', '2004-04-14', 'F', 123439, 1, 10, 11),
(63, 'Damri', 'Neila', 'TRAMPO NAMUR CLUB', '2004-06-14', 'F', 25026, 1, 62, 11),
(64, 'Granda Martinez', 'Noelia', 'Flying Acrobatics Trampoline Club', '2003-01-28', 'F', 66196, 1, 52, 12),
(65, 'Vanholder', 'Noah', 'Flying Acrobatics Trampoline Club', '2003-05-21', 'M', 101994, 1, 7, 12),
(66, 'Pirson', 'Maxime', 'TRAMPO NAMUR CLUB', '2000-11-08', 'M', 24332, 1, 19, 13);
--
-- Index pour les tables exportées
--
--
-- Index pour la table `person_gymnast`
--
ALTER TABLE `person_gymnast`
ADD PRIMARY KEY (`id`),
ADD KEY `person_gymnast_category_id_f8d57860_fk_technic_a` (`category_id`);
--
-- AUTO_INCREMENT pour les tables exportées
--
--
-- AUTO_INCREMENT pour la table `person_gymnast`
--
ALTER TABLE `person_gymnast`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=67;
--
-- Contraintes pour les tables exportées
--
--
-- Contraintes pour la table `person_gymnast`
--
ALTER TABLE `person_gymnast`
ADD CONSTRAINT `person_gymnast_category_id_f8d57860_fk_technic_a` FOREIGN KEY (`category_id`) REFERENCES `technic_availablecategory` (`id`);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

192
doc/Makefile Normal file
View File

@ -0,0 +1,192 @@
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = build
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " applehelp to make an Apple Help Book"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to run coverage check of the documentation (if enabled)"
clean:
rm -rf $(BUILDDIR)/*
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Khana.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Khana.qhc"
applehelp:
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
@echo
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
@echo "N.B. You won't be able to view it unless you put it in" \
"~/Library/Documentation/Help or install it in your application" \
"bundle."
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/Khana"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Khana"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
latexpdfja:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
coverage:
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
@echo "Testing of coverage in the sources finished, look at the " \
"results in $(BUILDDIR)/coverage/python.txt."
xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."

263
doc/make.bat Normal file
View File

@ -0,0 +1,263 @@
@ECHO OFF
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set BUILDDIR=build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source
set I18NSPHINXOPTS=%SPHINXOPTS% source
if NOT "%PAPER%" == "" (
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
)
if "%1" == "" goto help
if "%1" == "help" (
:help
echo.Please use `make ^<target^>` where ^<target^> is one of
echo. html to make standalone HTML files
echo. dirhtml to make HTML files named index.html in directories
echo. singlehtml to make a single large HTML file
echo. pickle to make pickle files
echo. json to make JSON files
echo. htmlhelp to make HTML files and a HTML help project
echo. qthelp to make HTML files and a qthelp project
echo. devhelp to make HTML files and a Devhelp project
echo. epub to make an epub
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
echo. text to make text files
echo. man to make manual pages
echo. texinfo to make Texinfo files
echo. gettext to make PO message catalogs
echo. changes to make an overview over all changed/added/deprecated items
echo. xml to make Docutils-native XML files
echo. pseudoxml to make pseudoxml-XML files for display purposes
echo. linkcheck to check all external links for integrity
echo. doctest to run all doctests embedded in the documentation if enabled
echo. coverage to run coverage check of the documentation if enabled
goto end
)
if "%1" == "clean" (
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
del /q /s %BUILDDIR%\*
goto end
)
REM Check if sphinx-build is available and fallback to Python version if any
%SPHINXBUILD% 1>NUL 2>NUL
if errorlevel 9009 goto sphinx_python
goto sphinx_ok
:sphinx_python
set SPHINXBUILD=python -m sphinx.__init__
%SPHINXBUILD% 2> nul
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
:sphinx_ok
if "%1" == "html" (
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
goto end
)
if "%1" == "dirhtml" (
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
goto end
)
if "%1" == "singlehtml" (
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
goto end
)
if "%1" == "pickle" (
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the pickle files.
goto end
)
if "%1" == "json" (
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the JSON files.
goto end
)
if "%1" == "htmlhelp" (
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
goto end
)
if "%1" == "qthelp" (
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Khana.qhcp
echo.To view the help file:
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Khana.ghc
goto end
)
if "%1" == "devhelp" (
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished.
goto end
)
if "%1" == "epub" (
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The epub file is in %BUILDDIR%/epub.
goto end
)
if "%1" == "latex" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
if errorlevel 1 exit /b 1
echo.
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "latexpdf" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
cd %BUILDDIR%/latex
make all-pdf
cd %~dp0
echo.
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "latexpdfja" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
cd %BUILDDIR%/latex
make all-pdf-ja
cd %~dp0
echo.
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "text" (
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The text files are in %BUILDDIR%/text.
goto end
)
if "%1" == "man" (
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The manual pages are in %BUILDDIR%/man.
goto end
)
if "%1" == "texinfo" (
%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
goto end
)
if "%1" == "gettext" (
%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
goto end
)
if "%1" == "changes" (
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
if errorlevel 1 exit /b 1
echo.
echo.The overview file is in %BUILDDIR%/changes.
goto end
)
if "%1" == "linkcheck" (
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
if errorlevel 1 exit /b 1
echo.
echo.Link check complete; look for any errors in the above output ^
or in %BUILDDIR%/linkcheck/output.txt.
goto end
)
if "%1" == "doctest" (
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
if errorlevel 1 exit /b 1
echo.
echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
goto end
)
if "%1" == "coverage" (
%SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage
if errorlevel 1 exit /b 1
echo.
echo.Testing of coverage in the sources finished, look at the ^
results in %BUILDDIR%/coverage/python.txt.
goto end
)
if "%1" == "xml" (
%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The XML files are in %BUILDDIR%/xml.
goto end
)
if "%1" == "pseudoxml" (
%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
goto end
)
:end

299
doc/source/conf.py Normal file
View File

@ -0,0 +1,299 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Khana documentation build configuration file, created by
# sphinx-quickstart on Thu Jan 7 09:55:31 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys
import os
import shlex
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('../../src'))
# os.environ['DJANGO_SETTINGS_MODULE'] = 'khana.settings'
# sys.path.insert(0, os.path.abspath('.'))
from django.conf import settings
settings.configure()
# import django
# django.setup()
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'Khana'
copyright = '2016, Trullemans Gregory'
author = 'Trullemans Gregory'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '1.0'
# The full version, including alpha/beta/rc tags.
release = '1.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'fr'
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = []
# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'alabaster'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
#html_extra_path = []
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Language to be used for generating the HTML full-text search index.
# Sphinx supports the following languages:
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr'
#html_search_language = 'en'
# A dictionary with options for the search language support, empty by default.
# Now only 'ja' uses this config value
#html_search_options = {'type': 'default'}
# The name of a javascript file (relative to the configuration directory) that
# implements a search results scorer. If empty, the default will be used.
#html_search_scorer = 'scorer.js'
# Output file base name for HTML help builder.
htmlhelp_basename = 'Khanadoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
# Latex figure (float) alignment
#'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'Khana.tex', 'Khana Documentation',
'Trullemans Gregory', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'khana', 'Khana Documentation',
[author], 1)
]
# If true, show URL addresses after external links.
#man_show_urls = False
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'Khana', 'Khana Documentation',
author, 'Khana', 'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# If false, no module index is generated.
#texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False

6
doc/source/gymnast.rst Normal file
View File

@ -0,0 +1,6 @@
Gymnastes
=========
.. autoclass:: people.models.Gymnast
:members:

24
doc/source/index.rst Normal file
View File

@ -0,0 +1,24 @@
.. Khana documentation master file, created by
sphinx-quickstart on Thu Jan 7 09:55:31 2016.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to Khana's documentation!
=================================
Contents:
.. toctree::
:maxdepth: 2
gymnast
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

192
docs/Makefile Normal file
View File

@ -0,0 +1,192 @@
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " applehelp to make an Apple Help Book"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to run coverage check of the documentation (if enabled)"
clean:
rm -rf $(BUILDDIR)/*
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Khana.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Khana.qhc"
applehelp:
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
@echo
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
@echo "N.B. You won't be able to view it unless you put it in" \
"~/Library/Documentation/Help or install it in your application" \
"bundle."
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/Khana"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Khana"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
latexpdfja:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
coverage:
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
@echo "Testing of coverage in the sources finished, look at the " \
"results in $(BUILDDIR)/coverage/python.txt."
xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."

297
docs/conf.py Normal file
View File

@ -0,0 +1,297 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Khana documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 8 13:28:52 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys
import os
import shlex
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('../src'))
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'khana.base_settings')
import django
django.setup()
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'Khana'
copyright = '2016, Trullemans Gregory'
author = 'Trullemans Gregory'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.0.2'
# The full version, including alpha/beta/rc tags.
release = '0.0.2'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'fr'
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'sphinx_rtd_theme'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
#html_extra_path = []
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Language to be used for generating the HTML full-text search index.
# Sphinx supports the following languages:
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr'
#html_search_language = 'en'
# A dictionary with options for the search language support, empty by default.
# Now only 'ja' uses this config value
#html_search_options = {'type': 'default'}
# The name of a javascript file (relative to the configuration directory) that
# implements a search results scorer. If empty, the default will be used.
#html_search_scorer = 'scorer.js'
# Output file base name for HTML help builder.
htmlhelp_basename = 'Khanadoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
# Latex figure (float) alignment
#'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'Khana.tex', 'Khana Documentation',
'Greggou', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'khana', 'Khana Documentation',
[author], 1)
]
# If true, show URL addresses after external links.
#man_show_urls = False
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'Khana', 'Khana Documentation',
author, 'Khana', 'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# If false, no module index is generated.
#texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False

88
docs/gymnast.rst Normal file
View File

@ -0,0 +1,88 @@
********************
Application `People`
********************
Modèles
*******
Gymnaste
========
.. autoclass:: people.models.Gymnast
:members:
.. autoclass:: people.models.CanDoRelation
:members:
.. autoclass:: people.models.ToDoRelation
:members:
Accident
========
.. autoclass:: people.models.Accident
:members:
Vues
****
Gymnaste
========
.. autofunction:: people.views.gymnast_listing
.. autofunction:: people.views.gymnast_lookup
.. autofunction:: people.views.gymnast_detail
Accident
========
.. autofunction:: people.views.accident_listing
.. autofunction:: people.views.accident_create
.. autofunction:: people.views.accident_detail
Divers
======
.. autofunction:: people.views.getRandomKnownSkill
Templates tags
==============
Gymnaste
--------
.. automodule:: people.templatetags.format
:members:
Entrainement
------------
.. automodule:: people.templatetags.training
:members:
Accident
--------
.. automodule:: people.templatetags.accident
:members:
.. automodule:: people.templatetags.chronos
:members:
Event
-----
.. automodule:: people.templatetags.event
:members:
.. automodule:: people.templatetags.plannification
:members:
Statistiques
------------
.. automodule:: people.templatetags.statistics
:members:

30
docs/index.rst Normal file
View File

@ -0,0 +1,30 @@
.. Khana documentation master file, created by
sphinx-quickstart on Fri Jan 8 13:28:52 2016.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
**********************************
Welcome to Khana's documentation !
**********************************
Contents:
.. toctree::
:maxdepth: 2
gymnast
location
planning
objective
******************
Indices and tables
******************
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

22
docs/location.rst Normal file
View File

@ -0,0 +1,22 @@
**********************
Application `Location`
**********************
Modèles
*******
.. autoclass:: location.models.Country
:members:
.. autoclass:: location.models.Place
:members:
.. autoclass:: location.models.Club
:members:
Vues
****
.. autofunction:: location.views.chooseStatistics
.. autofunction:: location.views.club_statistics

263
docs/make.bat Normal file
View File

@ -0,0 +1,263 @@
@ECHO OFF
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set BUILDDIR=_build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
set I18NSPHINXOPTS=%SPHINXOPTS% .
if NOT "%PAPER%" == "" (
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
)
if "%1" == "" goto help
if "%1" == "help" (
:help
echo.Please use `make ^<target^>` where ^<target^> is one of
echo. html to make standalone HTML files
echo. dirhtml to make HTML files named index.html in directories
echo. singlehtml to make a single large HTML file
echo. pickle to make pickle files
echo. json to make JSON files
echo. htmlhelp to make HTML files and a HTML help project
echo. qthelp to make HTML files and a qthelp project
echo. devhelp to make HTML files and a Devhelp project
echo. epub to make an epub
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
echo. text to make text files
echo. man to make manual pages
echo. texinfo to make Texinfo files
echo. gettext to make PO message catalogs
echo. changes to make an overview over all changed/added/deprecated items
echo. xml to make Docutils-native XML files
echo. pseudoxml to make pseudoxml-XML files for display purposes
echo. linkcheck to check all external links for integrity
echo. doctest to run all doctests embedded in the documentation if enabled
echo. coverage to run coverage check of the documentation if enabled
goto end
)
if "%1" == "clean" (
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
del /q /s %BUILDDIR%\*
goto end
)
REM Check if sphinx-build is available and fallback to Python version if any
%SPHINXBUILD% 1>NUL 2>NUL
if errorlevel 9009 goto sphinx_python
goto sphinx_ok
:sphinx_python
set SPHINXBUILD=python -m sphinx.__init__
%SPHINXBUILD% 2> nul
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
:sphinx_ok
if "%1" == "html" (
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
goto end
)
if "%1" == "dirhtml" (
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
goto end
)
if "%1" == "singlehtml" (
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
goto end
)
if "%1" == "pickle" (
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the pickle files.
goto end
)
if "%1" == "json" (
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the JSON files.
goto end
)
if "%1" == "htmlhelp" (
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
goto end
)
if "%1" == "qthelp" (
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Khana.qhcp
echo.To view the help file:
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Khana.ghc
goto end
)
if "%1" == "devhelp" (
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished.
goto end
)
if "%1" == "epub" (
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The epub file is in %BUILDDIR%/epub.
goto end
)
if "%1" == "latex" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
if errorlevel 1 exit /b 1
echo.
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "latexpdf" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
cd %BUILDDIR%/latex
make all-pdf
cd %~dp0
echo.
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "latexpdfja" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
cd %BUILDDIR%/latex
make all-pdf-ja
cd %~dp0
echo.
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "text" (
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The text files are in %BUILDDIR%/text.
goto end
)
if "%1" == "man" (
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The manual pages are in %BUILDDIR%/man.
goto end
)
if "%1" == "texinfo" (
%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
goto end
)
if "%1" == "gettext" (
%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
goto end
)
if "%1" == "changes" (
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
if errorlevel 1 exit /b 1
echo.
echo.The overview file is in %BUILDDIR%/changes.
goto end
)
if "%1" == "linkcheck" (
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
if errorlevel 1 exit /b 1
echo.
echo.Link check complete; look for any errors in the above output ^
or in %BUILDDIR%/linkcheck/output.txt.
goto end
)
if "%1" == "doctest" (
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
if errorlevel 1 exit /b 1
echo.
echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
goto end
)
if "%1" == "coverage" (
%SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage
if errorlevel 1 exit /b 1
echo.
echo.Testing of coverage in the sources finished, look at the ^
results in %BUILDDIR%/coverage/python.txt.
goto end
)
if "%1" == "xml" (
%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The XML files are in %BUILDDIR%/xml.
goto end
)
if "%1" == "pseudoxml" (
%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
goto end
)
:end

30
docs/objective.rst Normal file
View File

@ -0,0 +1,30 @@
***********************
Application `Objective`
***********************
Modèles
*******
.. autoclass:: objective.models.Educative
:members:
.. autoclass:: objective.models.TouchPosition
:members:
.. autoclass:: objective.models.Skill
:members:
.. autoclass:: objective.models.Routine
:members:
.. autoclass:: objective.models.Routine_Skill
:members:
.. autoclass:: objective.models.Chrono
:members:
Vues
****
.. automodule:: objective.views
:members:

56
docs/planning.rst Normal file
View File

@ -0,0 +1,56 @@
**********************
Application `Planning`
**********************
Modèles
*******
Génériques
==========
.. autoclass:: planning.models.Temporizable
:members:
.. autoclass:: planning.models.TemporizableQuerySet
:members:
.. automethod:: planning.models.get_number_of_weeks
Evènements
==========
.. autoclass:: planning.models.EventType
:members:
.. autoclass:: planning.models.Event
:members:
Cours et entrainements
======================
.. autoclass:: planning.models.Course
:members:
.. autoclass:: planning.models.Group
:members:
.. autoclass:: planning.models.Subgroup
:members:
.. autoclass:: planning.models.UnavailabilityManager
:members:
.. autoclass:: planning.models.Unavailability
:members:
.. autoclass:: planning.models.Training
:members:
Vues
****
.. automodule:: planning.views
:members:

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 523 KiB

Binary file not shown.

View File

@ -0,0 +1,117 @@
# Gestion des contraintes
Dans un circuit de compétition les séries imposées sont soumises à des contraintes. Certaines sont simples, d'autre pas.
## Contraintes Simples
Dans les contraintes **simples** nous avons :
- l'age minimum pour etre dans le niveau/catégorie
- l'age maximum pour être dans le niveau/catégorie
- le nombre de point nécessaire à la qualificaiton pour la phase suivante
- x sauts avec y degré de rotation minimum
Ces contraintes sont simples car facile a exprimer mais surtout elles sont présentes sous la même forme pour chaque série imposée. Elle peuvent donc être stocker au niveau de la table NIVEAU.
## Contraintes semi-complexes
Dans les contraintes **semi-complexes**, nous retrouvons :
- (3/4 arrière OU 3/4 avant ) ET barani tendu ET salto arrière tendu ET (cody OU bo OU bbo)
ou
- enchainement de Arrière Tendu, Barani carpé, arrière carpé
Ces contraintes semi-complèxes peuvent être séparées en contraintes atomiques. Exemple avec la première :
- 3/4 arrière
- OU 3/4 avant
- ET barani tendu
- ET arrière tendu
- ET cody
- OU bo
- OU bbo
La contrainte totale est la liaison (par `ET` et `OU`) des contraintes atomiques, c'est de la récursivité.
Exemple avec la seconde :
- série composée de :
- 1 - Arrière Tendu
- 2 - Barani Carpé
- 3 - Arrière carpé
Dans ce cas ci, c'est une série (enchainement de saut ordonnés).
Si l'on utilise deux table ces règles peuvent être modélisée.
### tables RULES
Cette tabe servirait de "mère" et générerait un ID. Elle aurait également comme champs : l'id d'une mère et d'un pere ainsi qu'un opérateur, permettant ainsi de lier par un `ET`ou un `OU` deux record déjà existant
ruleid ID (PK)
motherid ID (FK)
fatherid ID (FK)
operator Enum('AND', 'OR')
### tables CONSTRAINTS
Cette table, fille, récupérerait l'ID de la mère et posséderait les champs suivant :
ruleid ID (PK, FK)
label Varchar(255)
educativeid ID (FK)
##### Exemple
- 3/4 arrière
- OU 3/4 avant
- ET barani tendu
- ET arrière tendu
- ET cody
- OU bo
- OU bbo
Est modélisé par :
table RULES :
| ruleid | motherid | fatherid | operator |
|---------|-------------|------------|-------------|
| 1 | null | null | null |
| 2 | null | null | null |
| 3 | null | null | null |
| 4 | null | null | null |
| 5 | null | null | null |
| 6 | null | null | null |
| 7 | null | null | null |
| 8 | 1 | 2 | OR |
| 9 | 8 | 3 | AND |
| 10 | 9 | 4 | AND |
| 11 | 5 | 6 | OR |
| 12 | 11 | 7 | OR |
| 13 | 10 | 12 | AND |
table CONSTRAINTS :
| ruleid | label | educid |
|-----------------|-----------------|------------------|
| 1 | 3/4 arrière | x |
| 2 | 3/4 avant | y |
| 3 | barani tendu | z |
| 4 | arriere tendu | a |
| 5 | cody | b |
| 6 | bo | c |
| 7 | bbo | d |
## Contraintes complexes
- une récéption sur le dos/ventre ET une départ du dos/ventre (en combinaison) ET un double salto avant ou arrière avec ou sans vrille ET un saut avec minimum X degré de vrille et Y degré de salto.
On ne retrouve plus de lien vers des educatifs précis mais plutôt vers une description partielle :
- arrivée/départ ventre/dos
- double salto avant ou arrière avec ou sans vrille
- saut avec minimum X degré de vrille et Y degré de salto
Ici on attaque plus un educatif (saut) précis mais une caractèristique d'un saut (éducatif). Une arrivée ou un départ, c'est un record d'une autre table, mais une quantité de rotation, c'est un attribut d'une educatif (saut).
_______________________________________
### Comment réussir à modéliser cela correctement ????
__________________________

Binary file not shown.

View File

@ -0,0 +1,504 @@
# User Requirements & Table description
-----------------------------
## Partie GYMNAST
### Table GYMNAST
Un gymnaste est défini par les informations suivantes : nom, prénom, date de naissance, adresse, sexe, niss, téléphone (fixe), gsm et email, gsm du « père » et le gsm de la « mère » ainsi qu'une photo (booléen indiquant sil y a une photo => lie directement avec la photo). A cela il doit être possible d'ajouter des informations en relation directe avec le sport telles que : l'ID de la fédération, Actif (définit si le gymnaste pratique encore ou a arrêté) et une orientation (booléen désignant lorientation du gymnaste : gauche ou droite)
#####Design :
ID PK
Nom Varchar
Prenom Varchar
Birthdate Date
address Varchar
gender Bool
niss Varchar
phone Varchar
gsm Varchar
email Varchar
fedid Varchar
Gsmm Varchar
Gsmp Varchar
Active Bool
Picture Bool
Orientation Bool
### Table ACCIDENT
Il est important de pouvoir référencer les accidents qui surviennent afin de pouvoir les analyser et prévenir les prochains. De plus, les accidents font partie du gymnaste et peuvent avoir une influence : peur, doutes, …
Les informations essentielles dun accident sont la date à laquelle il sest produit, le gymnaste concerné ainsi que lobjectif sur lequel laccident sest produit. Une brève description, optionnelle, peut également être écrit : laccident y serait détaillé et les mesures à prendre pour éviter que cela se reproduise pourraient y être indiquées.
#####Design :
Id Id (PK)
GymID Int FK
ObjectiveID Int FK
Date Date
Information Text
### Table USER
Surtout basée sur la table User de Django.
-----------------------------
## Partie LOCATION
### Table PLACE
Lapplication doit pouvoir stocker des lieux (compétitions, rassemblements, festivités, …). Il faut donc pouvoir stocker une adresse (rue, CP, ville et pays). En plus de cela le lieu peut avoir un nom (« Sportpalais », « Ancienne Belgique », …) et un champ actif afin de pouvoir faciliter les filtres. A cela sajoute deux champs « nbkm » et « nbtemps » (calculé automatiquement ou manuellement) afin de pouvoir indiquer le nombre de kilomètres et le temps de parcours séparant le lieu de la salle dentrainement afin de pouvoir se faire une idée du temps de trajet.
#####Design :
Id Id (PK)
Name Varchar(255)
Address Varchar(3)
Postal PlaceID (FK)
City Varchar(255)
Country Varchar(255)
Nbkm Integer(3)
Active Booléen(1)
### Table CLUB
Un club porte un nom ainsi quun acronyme. Un club doit pouvoir être associé à un ou plusieurs lieux (de la table PLACE) et possède un champ actif afin de pouvoir faciliter les filtres.
#####Design :
Id Id (PK)
Name Varchar(255)
Acronym Varchar(3)
Place ForeignKey(Place)
Active Booléen(1)
### Table COUNTRY
La table country contient les informations ISO de tous les pays de la norme.
#####Design :
Id Id (PK)
Nameus Varchar(255)
Namefr Varchar(255)
nationality Varchar(255)
Iso2 Varchar(2)
Iso3 Varchar(3)
Isonum Varchar(3)
-----------------------------
## Partie SCHEDULE
Cette partie de l'application a pour but de gérer toute la notion de plannifications dans la vie du gymnaste (compétition, entrainement, liste de présence, plannification d'objectif, ...).
### Table COURSE
La table COURSE permet de représenter les cours donnés dans un club, un cours est donc lié à un club. Un cours devrait en fait être lié à une salle (un lieu) d'un club, car ce dernier peut avoir des cours dans plusieurs salles. Ces cours sont, par ailleurs, définis par : un jour, une heure de début et de fin ainsi quune date de début et de fin (du 1er sept au 30 juin, par exemple).
#####Design :
Id Id (PK)
daynumber Numéro du jour de la semaine (0 = lundi, 6 = dimanche)
Dbegin Date
Hbegin Time
Dend Date
Hend Time
clubid Int FK (Club)
Le but est de pouvoir lier des gymnastes à des cours pour pouvoir faire des listes de précences, des statistiques (nombre d'heure de présence, d'absence, total, …), … etc. Les cours sont donnés sous forme d'ensemble sécable ou insécable suivant le groupe du gymnaste.
### Table GROUP
Certains cours sont insécables. Par exemple : les gymnastes faisant partie dun groupe A (e.g. : D2) ont automatiquement les cours W, X, Y et Z. Ils ne peuvent pas (sauf exception) ne venir à X et Y mais pas à W et Z, … Cela introduit la notion de groupe. Un groupe est un ensemble dentrainements sur une semaine.
Les gymnastes se trouvent dans des groupes et chacun de ces groupes est lié à un ensemble d'entrainement. La problème est que cet ensemble peut être sécable (groupe de "D3" à cours 2 **ou** 3 fois par semaine : le lundi, vendredi et samedi) ou insécable (le groupe "D2 à cours 4 fois par semaine : le lundi, le mercredi, le vendredi **et** le samedi).
Comment représenter cela ?
Dans le cadre d'un ensemble sécable, le nombre d'entrainement maximum possible est différent du nombre d'entrainement minimum possible, ce qui n'est pas le cas dans un ensemble insécable. On pourrait donc stocker ces deux informations et se baser dessus. Le problème c'est que cela ne nous donne pas encore la possibilité de lié (fortement) un gymnaste à un cours (précis).
La solution est de créer une table "Sous-groupe" listant, pour chaque groupe, **toutes** les combinaisons possibles :
a) insécable (cf. D2)
- 1 seul sous-groupe possible : srgp0 : 4x/sem (L, M, V, S)
b) sécable (cf. D3) plusieurs sous-groupe possibles :
- sgrp1 : 3x/sem (L, V et S)
- sgrp2 : 2x/sem (L et V)
- sgrp3 : 2x/sem (L et S)
- sgrp4 : 2x/sem (V et S)
Un gymnaste appartenant à un groupe devrait suivre lensemble de ces entrainements. Cela nous donnerait une table GROUP telle que :
Id Id (PK)
club ID (FK)
label Varchar(255)
acronym Varchar(10)
active Booléen
### Table SUBGROUP
Chaque sous-groupe appartien à un (et un seul groupe).
#####Design :
id id (PK)
group id group (FK)
label Varchar(255)
acronym Varchar(255)
active Booléen
Une table de liaison (n,n ???) entre COURSE et SUBGROUP et une table de liaison (n,n ???) entre SUBGROUP et GYMNAST permettraient de lier les gymnastes avec les cours au travers de groupes et des sous-groupes.
### Table UNAVAILABILITY
Cette table va permettre de stocker des dates pour lesquelles il n'y aura ***pas*** cours. De manière plus précise, cette table sert à indiquer qu'une salle ne sera pas acessible ou, même si elle l'est, que le cours s'y donne habituellement ne s'y donne pas. `Lie-t-on au cours ou lie-t-on à la salle ? Lier à la salle peut impliquer de donner des informations fausses (salle qui serait inaccessible alors que non) mais permettrait de gerer des changements de salle (salle inaccessible mais cours donné dans une autre salle). Lier au cours permet de ne pas donner de fausses informations (salle pas réellement inaccessible) mais ne permet pas de gerer le remplacement du cours par un autre cours (one shot, …). Une idée ?`
#####
Design :
ID ID (PK)
datebegin date
dateend date
information text
### Table TRAINING
Cette table permet de lier un gymnaste à un cours, indiquant ainsi que quun gymnaste est venu à un cours. En plus de ces deux ID (Gym et cours), une date est stockée afin de pouvoir établir des feuilles de présence ainsi que calculer au mieux le nombre dheure de cours qua eu un gymnaste pendant une période donnée.
#####
Design :
Id Id (PK)
GymID Int FK (Gym)
CourseID Int FK (Course)
date Date
`La liste de présence a priori est proposée sur base de la liaison entre les gymnaste et les cours passant par les groupes et sous-groupe. La liste de présence a posteriori est basée sur les informations de cette table-ci`
### Table EVENT
Cette table permet de définir un événement : un nom, une date et une heure de début, une date et une heure de fin, le type (liaison par FK) ainsi que des informations (champs texte) relatives à cet événement.
Un événement est bien souvent organisé par un club, mais pas toujours. Il est possible que ce soit une fédération qui organise un événement, une firme, etc. On ne peut toujours pas obliger de liaison entre un événement et un club. Cependant un événement se déroule toujours dans un lieu précis, on doit dont pouvoir lier un événement à un lieu (PLACE).
#####
Design :
Id Id (PK)
PlaceID Int FK (PLACE)
TypeID Int FK (EVENTTYPE)
Dbegin DateTime
Dend DateTime
Information Text
### Table EVENTTYPE
Plusieurs type dévénement existe (démonstration, compétition qualificative, compétition finale, stage, … → dictionnaire fini). Ces types sont caractérisés par un label et un acronyme (en plus dun ID).
#####
Design :
Id Id (PK)
Label VarChar(255)
Acronym VarChar(255)
### Table TO_DO
(Description/requirements à venir)
### Table PLANING
(Description/requirements à venir)
### Table CAN_DO
La table CAN_DO a pour but de signifier quun gymnaste SAIT FAIRE (parce quon la déjà vu, constaté) un objectif. Le but (long terme) est dintroduire une intelligence dans le programme afin que ce dernier puisse nous proposer des listes de travail :
- des choses à travailler pour tendre vers des objectifs que lélève ne sait pas encore réalise ; r
- des choses à travailler pour améliorer la réalisation dobjectifs quil sait déjà réalise mais incorrectement ;r
- …
-----------------------------
## Partie OBJECTIVE
### Table TOUCH_POSITION
Cette table sert de dictionnaire et contient les informations nécessaires pour définir les positions darrivée/départ dun saut.
#####
Design :
LandingId ID (PK)
Label Varchar. Le nom (ventre, Genoux, 4 pattes, debout, …)
InCompetition Booléen
Default Booléen
Le champ « InCompetition» définit si larrivée est autorisée en compétition ou non. Cela aura pour conséquence que toute série comportant un mouvement (SKILL) dont larrivée et/ou le départ nest pas autorisée, ne sera pas autorisée en compétition.
Le champ « Default » définit la position par défaut. A la création dun nouveau mouvement, si la position de départ nest pas fournie, il faudra par déduction aller trouver soit la position darrivée du précédent mouvement (dans le cas dun enchaînement), soit la position par défaut dans la table de la base de données…
Il ne peut y avoir quune et une seule position par défaut dans toute la table ARRIVAL/POSITION. En plus, avec ce champ, on saurait quelle position ne doit pas être affichée dans le nom des mouvements.
### Table SKILL
En trampoline ce sont les mouvements qui ont un nom. Ces mouvements peuvent impliquer un départ particulier et/ou une arrivée particulière (assis, dos, ventre, …). Le « ventre » est le nom dun mouvement allant jusquau ventre. Le mouvement dépendra donc du contexte (i.e. du mouvement précédent) :
- ventre : debout tomber ventral, ¼ de rotation
- dos ventre : du dos aller jusquau ventre, 2/4 de rotation
- ¾ arrière : de debout aller jusquau ventre, en arrière, ¾ de rotation transversale
- Cody, ventre : du ventre, faire un salto arrière jusquau ventre, 4/4 de rotation
- Salto avant, ventre : de debout, salto avant jusquà un tomber ventral, 5/4 de rotation
- …
Le mouvement le plus simple (comportant le moins de ¼ de rotation) comportant une arrivée particulière prend, par convention, le nom de cette arrivée :
- debout, tomber ventral -> ventre
- debout, tomber dorsal -> dos
- debout, tomber quadrupédique -> 4 pattes
- debout, tomber assis -> assis
- debout, tomber curviligne ouvert -> ventre ouvert
- debout, tomber genoux -> genoux
Un mouvement, cest :
- une position de départ,
- un mouvement aérien,
- une position darrivée.
La position de départ est omise si elle est logique ou déductible (ex : salto avant → départ debout, salto avant, arrivée debout). On pourrait donc, dans linterface, nafficher que les positions de départ autre que debout.
La position darrivée est parfois omise si elle est logique ou déductible (ex : 4 pattes salto avant → sous-entend : 4 pattes salto avant, arrivé debout). On pourrait donc, dans linterface, nafficher que les positions de départ autre que debout.
Le mouvement aérien est, lui, composé de :
- un nom long,
- un nom court,
- un nombre de ¼ de rotation transversale
- un nombre de ½ de rotation longitudinale
- un type de rotation (avant/arrière)
- une position
Nom long et nom court :
Le nom long dun mouvement est composé de la position de départ (long label), le nom long du mouvement aérien (long label) et du nom long de la position darrivée (long label), ces trois informations étant séparés par une virgule. Pour le nom court, il en est de même avec le nom court des positions darrivée/de départ et du mouvement aérien.
Par exemple :
Nom du mouvement aérien : tomber
Nom long : départ debout, tomber, 4 pattes
Nom court : tomber, 4 pattes
Nom du mouvement aérien : salto avant
Nom long : départ 4 pattes, salto avant, arrivé debout
Nom court : 4 pattes, salto avant.
Question : dois-je stocker les noms courts et noms longs ou les générer à la volée en cas de besoin ? Je pense à les stocker car certains noms courts et longs sont particuliers, ils doivent donc pouvoir être personnalisables. Dois-je stocker le nom du mouvement aérien ? Sil ne me sert quà générer le nom court et/ou le nom long, cela ne sert à rien.
Certains mouvements ont des noms propres :
- Roller : Assis vrille, assis (départ non défini, tomber assis départ assis, vrille complète, retomber assis)
- Cattwist : Dos vrille, dos (départ non défini, tomber dos départ dos, vrille complète, retomber dos)
- Ball out : Dos salto avant, arrivé debout (départ non défini, tomber dos départ dos, salto avant, retomber debout)
- …
Ces noms seront alors stockés dans le label long ou court du mouvement. Sinon, De manière générale, le nom du mouvement est composé de la position darrivée concaténée au mouvement aérien (et de la position darrivée si elle est particulière).
Certains mouvements ne sont pas autorisés en compétition parce que le départ ou larrivée ne sont pas acceptés par le règlement. Il faut pouvoir distinguer ces mouvements. Pour cela, il suffit de distinguer les arrivées non autorisées.
Lautorisation dune arrivée étant contenue dans la table TOUCH_POSITION lautorisation dun mouvement peut-être déduit de lautorisation de larrivée :
1) 4 pattes : pas autorisé → 4 pattes salto avant : ne sera pas autorisé
2) ATR : pas autorisé → dos ATR : ne sera pas autorisé
3) Ventre : autorisé → Salto avant, arrivée ventre : 5/4 de rotation avant composés de salto avant directement lié à un tomber ventral (autorisée), le mouvement sera autorisé.
Cette déduction automatique vient du fait que chaque mouvement est lié (par le arrivalID) à une arrivée/départ (i.e. : ventre, dos, genoux, …)
#### Niveau, rang et difficulté
##### Difficulté
Le calcul de la difficulté d'un saut est définit dans le règlement technique international : 0,1pt par 1/4 de rotation salto ou par 1/2 vrille. A cela s'ajoute des bonus de positions (carpé ou tendue pour des salto simple sans vrille ou salto multiple) ou de réalisation de salto multiples (triple, quadruple).
##### Rang
En plus de la difficulté, chaque figure est réliée à d'autre(s) par les méthodologie d'apprentissage : il y a un ordre dans l'apprentissage basé sur la part méthode, sur des similitudes de forme, ... Un élève apprend, par exemple, le 4 pattes avant le ventre, le ventre avant le 3/4 arrière, et ainsi de suite. Il est donc possible de créer un*`arbre d'apprentissag*` sorte d'arbre généalogique d'un mouvement. Ainsi, il est possible, pour chaque élément, connaitre son rang (son*`étag*` dans l'arbre) et ainsi de pouvoir identifier pour un rang *X* l'ensemble de ses éléments de ce rang et de les travailler en même temps. Cela permet de s'assurer que l'élève avance de manière équivalente dans toutes les directions.
##### Niveau
La difficulté (à l'heure actuelle) ne prend pas tout en compte : un mouvement en position carpé ou tendu possède la même valeur de difficulté. Pourtant, ne serait ce que d'un point de vue biomécanique (et donc forces mises en jeu) un mouvement en position tendue est plus complexe et contraignant qu'un mouvement en position carpée.
Le rang quant à lui, s'il apporte une information supplémentaire importante, est aussi victime du nombre d'éducatif qui existe entre deux étapes. Prenons deux touches A et B, si pour aller à A il y a 4 étapes alors que pour aller à B il y en a 10, A sera de rang 5 alors que B sera de rang 11. Pourtant A et B pourraient être similaires (ex: A est salto avant groupé, B est salto arrière groupé. Tout les deux 4 quarts de rotation salto, sans vrille, départ des pieds, arrivée sur les pieds, même position, ...). On ne peut donc pas être entièrement satisfait par le rang.
Le but de ce champs est donc de mélanger les deux concepts : la notion de difficulté telle que définie par le règlement technique et les considérations physique/biomécanique et de pouvoir classer les figure entre elles par difficilté de réalisation, le tout en tenant également compte du rang. Cela devrait donner une sorte de rang "ventilé".
#### Design
En dehors de tout cela, un mouvement (complet) possède :
- nom long
- nom court
- position (0, o, <, / ou //)
- type de rotation (avant/arrière/NA)
- nombre de ¼ de rotation (salto)
- nombre de ½ rotation longitudinale (vrille)
- difficulté
- notation (code numérique du mouvement)
- notation simplifiée
- niveau
- rang
- educative
- prerequisite
#####
Design :
Skillid Id (PK)
longName Varchar(50)
shortName Varchar(25)
Position Enum (ou varchar(2)). Position du mouvement aérien.
rotationType Enum. Type de la rotation : avant, arrière ou sans objet.
nbRotation Int. Nombre de ¼ de rotation transversale
nbTwist Int. Nombre de ½ tour
Difficulty Float(3,1). Coefficient de difficulté
Notation Varchar(15). Notation alpha-numérique officielle internationnale.
simplyNotation Varchar(10). Notation alpha-numérique simplifiée.
level Int. Niveau du mouvement.
rank Int. Rang du mouvement.
educative FK(self)
prerequisite FK(self)
departurePosition arrivalID.
arrivalPosition arrivalID.
### Table EDUCATIVES
Un éducatif est un mouvement ou un enchainement de mouvements (plusieurs mouvements donc) qui va créer chez lélève un schéma corporel et/ou physiologique et/ou psychologique … pour lui permettre dapprocher un autre mouvement.
Exemple :
- « culbute avant » est léducatif du salto avant
- « petit piqué » est léducatif du salto avant
- « 4 pattes salto avant » est léducatif du salto avant
Chaque éducatif peut être lié à un (ou n) mouvement(s).
Chaque mouvement peut avoir un (ou n) éducatifs.
Chaque éducatif peut avoir un ou plusieurs éducatif.
→ Nous avons donc une relation n,n entre mouvements et éducatifs.
→ Nous avons également une relation n,n entre éducatifs
Les éducatifs dun mouvement (sil y en a plusieurs) peuvent (mais ne doivent pas forcément) avoir un ordre (partiel/flou). Un éducatif possède également un niveau. Lordre de plusieurs éducatifs pour un même saut peut être approximé en utilisant le niveau comme rang.
### Table ROUTINE
Cette table a pour but de pouvoir stocker des séries. Une série est un enchainement de saut (SKILL). Dans une série/enchaînement, la position de départ du mouvement n+1 est, logiquement, la position darrivée du mouvement n. Il pourrait donc être envisagé que lorsque linterface affiche un enchaînement de réduire les informations affichées :
- La position de départ du premier mouvement de toute série de mouvements est doffice « Debout ». Cette position peut donc ne pas être affichée.
- Pour les mouvements suivants :
- nafficher les arrivées que si elles sont différentes de « debout » puisque flaggée « Default »
- ne pas afficher les positions de départs puisque cest la position darrivée du mouvement précédent.
Donc un mouvement a une représentation textuelle ; une série de mouvements a une représentation textuelle également, basée sur les mouvements dont elle est composée.
Exemple :
Départ debout, tomber, 4 pattes départ 4 pattes, salto avant, arrivé debout.
On a donc bien un enchainement de deux mouvements, représenté chacun par une occurrence dans la table Skill :
1) Skill A : Départ debout, tomber, 4 pattes
2) Skill B : départ 4 pattes, salto avant, arrivé debout.
Cet enchaînement peut, par simplification évoquée ci-avant, sécrire :
4 pattes salto avant
La représentation de A est la suivante :
- Debout est ignoré car cest la position par défaut
- Tomber quatre pattes est la représentation textuelle
La représentation de B est la suivante :
- Quatre pattes est ignoré, car B nest pas le premier mouvement de lenchaînement (donc B.Departure = A.Arrival)
- La position darrivée (debout) est ignorée car cest la position par défaut
- Salto avant reste la valeur textuelle.
En concaténant les deux, il reste : « Tomber quatre pattes, salto avant ».
Explications :
- On omet la position du départ du mouvement tomber 4 pattes car elle est logique (départ debout).
- On omet la position du départ du salto avant car elle est logique par rapport au mouvement davant (départ 4 pattes).
- On omet la position darrivée du salto avant car elle est logique (arrivée debout).
Problème : comment noter les tombers ? Ici le « tomber 4 pattes » na que deux informations : la position de départ et la position darrivée. Peut-être pourrait-on dire que le mouvement est le « tomber ». On aurait alors :
« Départ debout, tomber, 4 pattes »
Tel que :
« Position de départ, mouvement, position darrivée ».
Une série est un enchainement de mouvements (nayant pas de but direct ou indirect déducatif). Les séries sont, en grande généralité, des exercices de compétition (10 sauts, que des arrivées autorisées, …) mais pas toujours : elles peuvent aussi avoir pour but un travail précis (hauteur, vrille, …) et utiliser des mouvements comportant des arrivées et/ou des départs non autorisés, elles peuvent comporter un nombre non limité de sauts, …
Les mouvements de séries ont obligatoirement un ordre à lintérieur de celle-ci : il y a le mouvement 1, le mouvement 2, … le mouvement n.
Une série possède :
- un nom court,
- un nom long,
- un coefficient de difficulté (somme des coefficients de difficulté des mouvements composant la série),
- un niveau,
- une date qui, si elle est remplie, indique à partir de quand la série nest plus valable.
Dans le cas de compétition, il y a deux séries : imposé et libre. La libre est différente pour chacun mais elle doit répondre à certains critères définis avec (en même temps) que limposé : un minimum de difficulté, un maximum de difficulté et minimum (de point) de qualification. Ces trois informations sont donc, par convention, associées à la « série imposée » et non à la « série libre ».
De plus, une série imposée peut comporter des limite dâge (âge min, âge max) quil est important de connaître afin de na pas attribuer une série à un gym qui ne correspondrait pas aux critères dâge.
Une série imposée doit donc pouvoir être (re)connue comme telle.
GT Réflexion :
Un imposé est « imposé » dans un circuit de compétition X.
X et Y sont deux circuits de compétitions différents, mais nont pas forcément les mêmes imposés. Ne serait-il pas intéressant de référencer les différents circuits de compétitions et dy associer les séries imposées et les exigences (âge, diff, …) ? Si oui, comme faire cela ? (et quand faire cette étape sachant que ce nest pas la plus importante).
La date est là pour indiquer si une série « imposée » est encore active ou pas. Cela permet de garde un historique des séries qui, un jour, seront associés à des élèves et/ou des compétitions. => lien avec le pays & la période/saison (période de dates) ?
### Table OBJECTIVES
Un objectif est un but à atteindre, une étape à franchir (pas forcément obligatoire) par lélève. Un objectif peut être :
- un mouvement (record de la table SKILL),
- un éducatif (record de la table EDUCATIVE) ou
- une série (record de la table ROUTINE).
A terme, un objectif devra pouvoir être associé à un élève (via une fonction de planning, de liste de tache/todo, …)
La table OBJECTIVE est donc la table mère dans un héritage. Les tables héritant delle sont : SKILL, EDUCATIVE et ROUTINE.
----------------------------
## Partie COMPETITION
### Table COMPETITION
Un circuit de compétition est enregistré dans cette table. Il est définit par un nom, une saison (?) et un règlement. Le règlement, sous forme dun fichier PDF, sera enregistrer par le site.
#####
Design :
ID ID (PK)
Label Varchar. Nom du circuit de compétition
Acronym Varchar. Acronyme du circuit de compétition
Reglement File. Fichier PDF du réglèment du circuit
### Table DIVISION
Un circuit de compétition se compose de 1 à N divisions. Chaque division se subdivise en niveau basé sur lâge ou sur dautre critère. Afin de représenter cela nous allons utiliser une table division.
#####
Design :
ID ID (PK)
CompetitionID ID (FK)
Name Varchar. Nom de la division
Acronym Varchar. Acronyme de la division
### Table NIVEAU
Un niveau est composé dune série imposé (ou libre à exigence) ainsi que des contraintes :
- nombre de points quil faut pour être qualifié pour la phase suivante,
- une difficulté minimale (et parfois maximale aussi),
- un âge minimum (et parfois maximum aussi)
La série imposée est soit :
- totalement imposé : 10 sauts sont imposé ainsi que leur ordre.
- partiellement imposé :
- certains sauts sont imposés totalement (avec des ET ou des OU) ou partiellement (obligation dune arrivée ou dun départ spécifique)
- un ordre peut être imposé (pour ces sauts)
- un nombre de saut ayant une certain quantité de rotation (en degré) est imposé (ex : « 5 saut de 270° de rotation minimum »)
#####
Design :
ID ID (PK)
DivisionID ID (FK)
Name Varchar. Nom du niveau
Acronym Varchar. Acronyme du niveau
Agemin Int. Age minimum
Agemax Int. Age maximum
QualifPoint Double(6,3). Point pour être qualifié pour la phase suivante
Pour le reste de la table, je dois encore réfléchir.
----------------------------
## Partie UTILISATEURS
Avec ce programme je souhaite pouvoir gérer mes gymnastes : leurs présence, leur participation à des évènements, leur objectifs, … Je souhaite également permettre aux moniteurs avec qui je travaille davoir accès à ces informations.
Cependant comme je travaille dans plusieurs clubs, il faudrait que je puisse moi- voir tous les gymnastes mais que les moniteurs se connectant ne puissent voir les gymnastes que de leur club. Il faudrait donc lier un utilisateur à un club et les gymnastes à un club. La liaison gym <-> club peut se faire grâce aux tables COURSE et TRAINING. Pour les Utilisateurs, il faudrait une table USER (déjà générée par Django) et une table de liaison entre la table CLUB et cette table USER. Est-ce possible ?

Binary file not shown.

View File

@ -0,0 +1,66 @@
# Fonctionnalités souhaitées
## Utilisateurs, entraineurs et gymnastes
Plusieurs personnes doivent pouvoir utiliser l'application : chaque entraineur ! Un entraineur est une personne (user donc) qui est associée à, au moins, un cours. Ou plutôt, chaque cours doit avoir au moins un entraineur (un cours pour avec 1+ entraineurs, un entraineur peut donner plusieurs cours).
Un user est un entraineur et vice-versa.
Un gymnaste peut également être un entraîneur et donc un utilisateur. Entraineur et gymnaste ont beaucoup de champs en commun :
- lastname
- firstname
- birthdate (pas obligatoire mais utile pour une entraineur)
- sexe
- niss
- address
- box
- postal
- city
- phone (pas obligatoire ni pour un gym ni pour un entraineur)
- gsm
- email
- ffgid
- active
- picture
Il reste quelques champs (trois) qui ne sont utilisés QUE pour les gymnastes :
- gsmm
- gsmp
- orientation
Alors...
Combien de tables dois-je avoir ?
- deux : user et gymnast avec une relation 1 - 1 ?
- trois : user, trainer et gymnast avec une relation 1 - 1 | 0 ?
Et comment les lier ?
==> il y a tellement peu de différences entre les deux (entraineur et gymnaste) que je pense qu'une seule table ()pour les deux types de personne) peut largement suffire quitte à ajouter des champs pour flagguer s'ils sont gymnaste (True/False) et entraineur (True/False). Ensuite, on pourrait lier la table USER de Django avec la table (renommée en PEOPLE, par exemple) pour en plus pouvoir signaler quelles personnes sont, en plus, des utilisateurs du site. On aurait donc DEUX tables en tout avec une liaison O2O.
Qu'en penses-tu ?
## Liste de présences ?
Grâce aux tables Group, Subgroup et aux tables de liaisons vers les gymnastes et le club, il est possible de générer des feuilles de présence.
Ces listes de présence sont générées par rapport au cours (jour), aux (sous-)groupes et aux gymnastes. Sur base de cela, le site génére une liste des jours ou il devrait y avoir cours. La notion importante est "***devrait*** avoir cours". En effet, il est possible que un cours n'ait pas pu être donné car l'entraineur n'était pas disponible, la salle était indisponible, … etc.
Je souhaite pouvoir faire des statistiques précises (le plus possible) il est important de pouvoir connaitre avec précision les cours donnés ou pas afin de pouvoir tenir compte des vacances (toussaint, noel, carnaval, paques, grande vacances, jours fériés, ...).
Comment stocker cette informations ?
Design proposé :
ID ID (PK)
datebegin date
dateend date
information text
Pour la génération des listes de présences, il faudrait combiner la table COURSES, les jours générés et les records de ma table ci-dessus.
Qu'en penses-tu ?
De manière générale, j'ai beaucoup de mal avec la complémentarité de mes données datées : dois-je stocker que ce qui **est** ? Dois-je stocker que ce qui **n'est pas** ? Dois-je stocker **les deux** ?

View File

@ -0,0 +1,6 @@
```
python manage.py makemessages -f fr
python manage.py compilemessages
```
The `LOCALE_PATHS` variable is already set in the `settings.py` file.

9
requirements/base.txt Normal file
View File

@ -0,0 +1,9 @@
Django==3.0.3
pyaml==19.12.0
PyYAML==5.3
Markdown==3.2.1
reportlab==3.5.34
simplejson==3.17.0
Sphinx==2.4.1
django-extensions==2.2.8
djangorestframework==3.11.0

8
requirements/dev.txt Normal file
View File

@ -0,0 +1,8 @@
-r base.txt
flake8==3.7.9
coverage==5.0.3
django-spaghetti-and-meatballs==0.2.2
docutils==0.16
pytest==5.3.5
black==19.10b0

View File

@ -0,0 +1,4 @@
-r dev.txt
mysqlclient==1.4.6
sqlparse==0.3.0

192
src/Makefile Normal file
View File

@ -0,0 +1,192 @@
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = build
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " applehelp to make an Apple Help Book"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to run coverage check of the documentation (if enabled)"
clean:
rm -rf $(BUILDDIR)/*
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Khana.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Khana.qhc"
applehelp:
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
@echo
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
@echo "N.B. You won't be able to view it unless you put it in" \
"~/Library/Documentation/Help or install it in your application" \
"bundle."
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/Khana"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Khana"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
latexpdfja:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
coverage:
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
@echo "Testing of coverage in the sources finished, look at the " \
"results in $(BUILDDIR)/coverage/python.txt."
xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."

0
src/base/__init__.py Normal file
View File

27
src/base/models.py Normal file
View File

@ -0,0 +1,27 @@
from django.db import models
import markdown
class Markdownizable(models.Model):
class Meta:
abstract = True
information = models.TextField(
null=True,
blank=True,
verbose_name="Comments",
help_text="Seul le MarkDown simple est accepté",
)
def to_markdown(self):
"""
Convertit le commentaire associé au `skill` en (Github-flavored) Markdown.
"""
# parser = CommonMark.DocParser()
# ast = parser.parse(self.information)
html = markdown.markdown(self.information)
return html
# return CommonMark.HTMLRenderer().render(ast)

View File

View File

@ -0,0 +1,17 @@
from django.contrib import admin
# Register your models here.
from .models import Message
from django_extensions.admin import ForeignKeyAutocompleteAdmin
class MessageAdmin(admin.ModelAdmin):
model = Message
list_display = ("writer", "reader", "date_of_writing", "is_read", "date_of_reading")
ordering = ("date_of_writing", "writer")
search_fields = ("writer", "reader", "message_title")
list_filter = ("writer", "reader", "is_read")
admin.site.register(Message, MessageAdmin)

View File

@ -0,0 +1,5 @@
from django.apps import AppConfig
class CommunicationConfig(AppConfig):
name = "communication"

View File

@ -0,0 +1,37 @@
# coding=UTF-8
from django import forms
from datetime import date
from .models import Message
from people.models import Gymnast
class MessageForm(forms.ModelForm):
class Meta:
model = Message
fields = (
"writer",
"reader",
"message_title",
"message_body",
)
widgets = {
"writer": forms.HiddenInput(),
"reader": forms.HiddenInput(),
"message_title": forms.TextInput(
attrs={"class": "form-control", "placeholder": "Title's message."}
),
"message_body": forms.Textarea(
attrs={"class": "form-control", "placeholder": "Body's'message.",}
),
}
reader_related = forms.CharField(
widget=forms.TextInput(
attrs={
"class": "form-control",
"placeholder": "Trainer search…",
"data-ref": "#id_reader",
}
)
)

View File

@ -0,0 +1,64 @@
# Generated by Django 2.1.7 on 2019-04-13 10:18
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name="Message",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"date_of_writing",
models.DateField(auto_now_add=True, verbose_name="Date of writing"),
),
(
"date_of_reading",
models.DateField(auto_now=True, verbose_name="Date of reading"),
),
("is_read", models.BooleanField(default=False)),
(
"message_title",
models.CharField(max_length=255, verbose_name="Title"),
),
(
"message_body",
models.TextField(blank=True, null=True, verbose_name="Message"),
),
(
"reader",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="have_read",
to=settings.AUTH_USER_MODEL,
),
),
(
"writer",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="have_write",
to=settings.AUTH_USER_MODEL,
),
),
],
),
]

View File

@ -0,0 +1,25 @@
# Generated by Django 2.1.7 on 2019-04-13 10:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("communication", "0001_initial"),
]
operations = [
migrations.AlterField(
model_name="message",
name="date_of_reading",
field=models.DateTimeField(auto_now=True, verbose_name="Date of reading"),
),
migrations.AlterField(
model_name="message",
name="date_of_writing",
field=models.DateTimeField(
auto_now_add=True, verbose_name="Date of writing"
),
),
]

View File

View File

@ -0,0 +1,24 @@
# coding=UTF-8
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Message(models.Model):
"""
Communication entre user
"""
writer = models.ForeignKey(
User, on_delete=models.CASCADE, related_name="have_write"
)
date_of_writing = models.DateTimeField(
auto_now_add=True, verbose_name="Date of writing"
)
reader = models.ForeignKey(User, on_delete=models.CASCADE, related_name="have_read")
date_of_reading = models.DateTimeField(
auto_now=True, verbose_name="Date of reading"
)
is_read = models.BooleanField(default=False)
message_title = models.CharField(max_length=255, verbose_name="Title")
message_body = models.TextField(null=True, blank=True, verbose_name="Message",)

View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

14
src/communication/urls.py Normal file
View File

@ -0,0 +1,14 @@
# coding=UTF-8
from django.urls import path, re_path
from . import views
# Message
message_urlpatterns = [
path(r"sent/", views.get_message_sent, name="message_sent"),
path(r"received/", views.get_message_received, name="message_received"),
path(r"<int:messageid>/", views.get_message_details, name="message_details"),
path(r"delete/<int:messageid>/", views.delete_message, name="delete_message"),
path(r"compose/", views.compose_message, name="compose_message"),
]

View File

@ -0,0 +1,99 @@
# coding=UTF-8
from django.views.decorators.http import require_http_methods
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, get_object_or_404
from django.contrib.auth.models import User
from django.urls import reverse
from .forms import MessageForm
from .models import Message
# @login_required
def get_number_unreaded_message(request):
"""
"""
# user = User.objects.get(pk=userid)
number_unreaded_message = Message.objects.filter(reader=request.user).count()
return number_unreaded_message
@login_required
@require_http_methods(["GET"])
def get_messages(request, message_type="received"):
"""
"""
if message_type == "received":
message_list = Message.objects.filter(reader=request.user)
elif message_type == "sent":
message_list = Message.objects.filter(writer=request.user)
else:
message_list = None
context = {"message_list": message_list, "message_type": message_type}
return render(request, "message_list.html", context)
@login_required
@require_http_methods(["GET"])
def get_message_received(request):
"""
"""
return get_messages(request, "received")
@login_required
@require_http_methods(["GET"])
def get_message_sent(request):
"""
"""
return get_messages(request, "sent")
@login_required
@require_http_methods(["GET"])
def get_message_details(request, messageid):
"""
"""
message = get_object_or_404(Message, pk=messageid)
if not message.is_read and message.reader == request.user.id:
message.is_read = True
message.save()
context = {"message": message, "type": None}
return render(request, "message_details.html", context)
@login_required
@require_http_methods(["GET"])
def delete_message(request, messageid):
"""
"""
try:
Message.objects.get(pk=messageid).delete()
except:
return HttpResponse(409)
return HttpResponse(200)
@login_required
@require_http_methods(["GET", "POST"])
def compose_message(request):
"""
"""
if request.method == "POST":
form = MessageForm(request.POST)
if form.is_valid():
form.save()
return HttpResponseRedirect(reverse("message_sent"))
else:
print("Form invalide")
else:
form = MessageForm()
context = {"form": form, "writer": request.user.id}
return render(request, "message_create.html", context)

View File

25
src/competition/admin.py Normal file
View File

@ -0,0 +1,25 @@
from django.contrib import admin
# Register your models here.
from .models import Competition, Point, Division, Level
class PointAdmin(admin.ModelAdmin):
model = Point
list_display = (
"gymnast",
"point_execution",
"point_difficulty",
"point_time_of_flight",
"total",
)
ordering = ("gymnast",)
# search_fields = ('longLabel', 'shortLabel')
list_filter = ("gymnast", "event", "routine_type")
admin.site.register(Competition)
admin.site.register(Point, PointAdmin)
admin.site.register(Division)
admin.site.register(Level)

75
src/competition/forms.py Normal file
View File

@ -0,0 +1,75 @@
# coding=UTF-8
from django import forms
from datetime import date
from .models import Point
class ScoreForm(forms.ModelForm):
class Meta:
ROUTINETYPE_CHOICE = (
(0, "Routine 1"),
(1, "Routine 2"),
(2, "Final's routine"),
)
model = Point
fields = (
"gymnast",
"event",
"routine_type",
"point_difficulty",
"point_time_of_flight",
"point_execution",
"point_horizontal_displacement",
"penality",
"total",
)
widgets = {
"gymnast": forms.HiddenInput(),
"event": forms.HiddenInput(),
"routine_type": forms.Select(attrs={"class": "form-control"}),
"point_execution": forms.NumberInput(
attrs={"class": "form-control", "placeholder": "xx,xx",}
),
"point_difficulty": forms.NumberInput(
attrs={"class": "form-control", "placeholder": "xx,xx",}
),
"point_time_of_flight": forms.NumberInput(
attrs={"class": "form-control", "placeholder": "xx,xx",}
),
"point_horizontal_displacement": forms.NumberInput(
attrs={"class": "form-control", "placeholder": "x,xx",}
),
"penality": forms.NumberInput(
attrs={"class": "form-control", "placeholder": "xx,xx", "value": "0"}
),
"total": forms.TextInput(
attrs={
"class": "form-control",
"placeholder": "000,000",
"readonly": "readonly",
"maxlength": "6",
}
),
}
gymnast_related = forms.CharField(
widget=forms.TextInput(
attrs={
"class": "form-control",
"placeholder": "Searching…",
"data-ref": "#id_gymnast",
}
)
)
event_related = forms.CharField(
widget=forms.TextInput(
attrs={
"class": "form-control",
"placeholder": "Searching…",
"data-ref": "#id_event",
}
)
)

View File

@ -0,0 +1,91 @@
# Generated by Django 2.1.7 on 2019-03-16 16:58
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Competition",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=255)),
("acronym", models.CharField(max_length=10)),
("reglement", models.FileField(blank=True, null=True, upload_to="")),
],
),
migrations.CreateModel(
name="Division",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=255)),
("acronym", models.CharField(max_length=10)),
],
),
migrations.CreateModel(
name="Level",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=255)),
("acronym", models.CharField(max_length=10)),
],
),
migrations.CreateModel(
name="Point",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"routineType",
models.IntegerField(
choices=[
(0, "Routine 1"),
(1, "Routine 2"),
(2, "Final's routine"),
]
),
),
("pointE", models.DecimalField(decimal_places=1, max_digits=3)),
("pointD", models.DecimalField(decimal_places=1, max_digits=3)),
("pointToF", models.DecimalField(decimal_places=3, max_digits=5)),
("penality", models.DecimalField(decimal_places=1, max_digits=3)),
("total", models.DecimalField(decimal_places=3, max_digits=6)),
],
),
]

View File

@ -0,0 +1,54 @@
# Generated by Django 2.1.7 on 2019-03-16 16:58
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
("planning", "0001_initial"),
("competition", "0001_initial"),
("people", "0001_initial"),
]
operations = [
migrations.AddField(
model_name="point",
name="event",
field=models.ForeignKey(
default=None,
on_delete=django.db.models.deletion.CASCADE,
to="planning.Event",
),
),
migrations.AddField(
model_name="point",
name="gymnast",
field=models.ForeignKey(
default=None,
on_delete=django.db.models.deletion.CASCADE,
to="people.Gymnast",
),
),
migrations.AddField(
model_name="level",
name="division",
field=models.ForeignKey(
default=None,
on_delete=django.db.models.deletion.CASCADE,
to="competition.Division",
),
),
migrations.AddField(
model_name="division",
name="competition",
field=models.ForeignKey(
default=None,
on_delete=django.db.models.deletion.CASCADE,
to="competition.Competition",
),
),
]

View File

@ -0,0 +1,25 @@
# Generated by Django 2.1.7 on 2019-04-02 20:26
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("competition", "0002_auto_20190316_1658"),
]
operations = [
migrations.RenameField(
model_name="point", old_name="pointD", new_name="point_difficulty",
),
migrations.RenameField(
model_name="point", old_name="pointE", new_name="point_execution",
),
migrations.RenameField(
model_name="point", old_name="pointToF", new_name="point_time_of_flight",
),
migrations.RenameField(
model_name="point", old_name="routineType", new_name="routine_type",
),
]

View File

@ -0,0 +1,20 @@
# Generated by Django 2.1.7 on 2019-04-02 20:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("competition", "0003_auto_20190402_2026"),
]
operations = [
migrations.AlterField(
model_name="point",
name="routine_type",
field=models.PositiveIntegerField(
choices=[(0, "Routine 1"), (1, "Routine 2"), (2, "Final's routine")]
),
),
]

View File

@ -0,0 +1,20 @@
# Generated by Django 2.1.7 on 2019-04-02 20:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("competition", "0004_auto_20190402_2032"),
]
operations = [
migrations.AlterField(
model_name="point",
name="routine_type",
field=models.PositiveSmallIntegerField(
choices=[(0, "Routine 1"), (1, "Routine 2"), (2, "Final's routine")]
),
),
]

View File

@ -0,0 +1,24 @@
# Generated by Django 2.1.7 on 2019-04-29 11:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("competition", "0005_auto_20190402_2035"),
]
operations = [
migrations.AddField(
model_name="point",
name="point_horizontal_displacement",
field=models.DecimalField(decimal_places=3, default=0, max_digits=4),
preserve_default=False,
),
migrations.AlterField(
model_name="point",
name="point_execution",
field=models.DecimalField(decimal_places=3, max_digits=5),
),
]

View File

@ -0,0 +1,20 @@
# Generated by Django 2.1.7 on 2019-05-24 12:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("competition", "0006_auto_20190429_1125"),
]
operations = [
migrations.AlterField(
model_name="point",
name="routine_type",
field=models.PositiveSmallIntegerField(
choices=[(0, "Routine 1"), (1, "Routine 2"), (2, "Final")]
),
),
]

View File

70
src/competition/models.py Normal file
View File

@ -0,0 +1,70 @@
# coding=UTF-8
from django.db import models
class Point(models.Model):
"""
"""
ROUTINETYPE_CHOICE = ((0, "Routine 1"), (1, "Routine 2"), (2, "Final"))
gymnast = models.ForeignKey(
"people.Gymnast", on_delete=models.CASCADE, default=None
)
event = models.ForeignKey("planning.Event", on_delete=models.CASCADE, default=None)
# routine=models.ForeignKey('objective.Routine')
routine_type = models.PositiveSmallIntegerField(choices=ROUTINETYPE_CHOICE)
point_execution = models.DecimalField(max_digits=5, decimal_places=3)
point_difficulty = models.DecimalField(max_digits=3, decimal_places=1)
point_time_of_flight = models.DecimalField(max_digits=5, decimal_places=3)
point_horizontal_displacement = models.DecimalField(max_digits=4, decimal_places=3)
penality = models.DecimalField(max_digits=3, decimal_places=1)
total = models.DecimalField(max_digits=6, decimal_places=3)
def __str__(self):
return "%s, %s - %s" % (
self.gymnast.lastname,
self.gymnast.firstname,
self.total,
)
class Competition(models.Model):
"""
Classe représentant une compétition.
"""
name = models.CharField(max_length=255)
acronym = models.CharField(max_length=10)
reglement = models.FileField(upload_to="", null=True, blank=True)
def __str__(self):
return "%s (%s)" % (self.name, self.acronym)
class Division(models.Model):
"""
Commentaire de la classe Division
"""
competition = models.ForeignKey(Competition, on_delete=models.CASCADE, default=None)
name = models.CharField(max_length=255)
acronym = models.CharField(max_length=10)
def __str__(self):
return "%s (%s)" % (self.name, self.acronym)
class Level(models.Model):
"""
Commentaire de la classe Division
"""
division = models.ForeignKey(Division, on_delete=models.CASCADE, default=None)
name = models.CharField(max_length=255)
acronym = models.CharField(max_length=10)
def __str__(self):
return "%s (%s)" % (self.name, self.acronym)

38
src/competition/tests.py Normal file
View File

@ -0,0 +1,38 @@
from django.test import TestCase
from .models import Point, Competition, Division, Level
class TestModelCompetition(TestCase):
"""
Tests relatifs à la classe `Compétition`.
"""
def test_str_(self):
""" Vérifie la représentation textuelle de la classe. """
competition = Competition(name="Belgian Open Trampoline", acronym="BOT")
self.assertEqual("Belgian Open Trampoline (BOT)", str(competition))
class TestModelDivision(TestCase):
"""
Tests relatifs à la classe `Division`.
"""
def test_str_(self):
""" Vérifie la représentation textuelle de la classe. """
competition = Competition(name="Belgian Open Trampoline", acronym="BOT")
division = Division(name="Division 1", acronym="D1", competition=competition)
self.assertEqual("Division 1 (D1)", str(division))
class TestModelLevel(TestCase):
"""
Tests relatifs à la classe `Level`.
"""
def test_str_(self):
""" Vérifie la représentation textuelle de la classe. """
competition = Competition(name="Belgian Open Trampoline", acronym="BOT")
division = Division(name="Division 1", acronym="D1", competition=competition)
level = Level(name="Argent", acronym="Ag", division=division)
self.assertEqual("Argent (Ag)", str(level))

16
src/competition/urls.py Normal file
View File

@ -0,0 +1,16 @@
# coding=UTF-8
from django.urls import path
from . import views
score_urlpatterns = [
path(
r"add/<int:gymnastid>",
views.score_create_or_update,
name="score_create_for_gymnast",
),
path(r"add", views.score_create_or_update, name="score_create"),
path(r"edit/<int:scoreid>", views.score_create_or_update, name="score_update"),
path(r"", views.score_listing),
]

69
src/competition/views.py Normal file
View File

@ -0,0 +1,69 @@
# coding=UTF-8
from django.shortcuts import render, get_object_or_404
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseRedirect
from django.views.decorators.http import require_http_methods
from .forms import ScoreForm
from .models import Point
from people.models import Gymnast
@login_required
@require_http_methods(["GET", "POST"])
def score_create_or_update(request, scoreid=None, gymnastid=None):
"""
Formulaire de création d'un nouveau score.
"""
if scoreid:
score = get_object_or_404(Point, pk=scoreid)
data = {
"gymnast_related": str(score.gymnast),
"event_related": str(score.event),
}
else:
score = None
data = {}
if gymnastid is not None:
gymnast = get_object_or_404(Gymnast, pk=gymnastid)
data["gymnast"] = gymnastid
data["gymnast_related"] = str(gymnast)
if request.method == "POST":
form = ScoreForm(request.POST, instance=score)
if form.is_valid():
# print(form.cleaned_data)
form.save()
return HttpResponseRedirect(
"/gymnast/" + str(form.cleaned_data["gymnast"].id) + "/tab/scores/"
)
# return HttpResponseRedirect("/score/")
else:
form = ScoreForm(instance=score, initial=data)
context = {"form": form, "scoreid": scoreid}
return render(request, "score_create.html", context)
@login_required
@require_http_methods(["GET"])
def score_listing(request):
"""
Revoie la liste des scores
"""
pattern = request.GET.get("pattern", None)
if pattern:
score_list = Point.objects.filter(
Q(event__icontains=pattern) | Q(gymnast__icontains=pattern)
)
else:
score_list = Point.objects.all()
context = {"score_list": score_list}
return render(request, "score_list.html", context)

File diff suppressed because one or more lines are too long

0
src/khana/__init__.py Normal file
View File

132
src/khana/base_settings.py Normal file
View File

@ -0,0 +1,132 @@
"""
Django settings for khana project.
Generated by 'django-admin startproject' using Django 1.8.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "6@9p0g-5ebcttbt$^*s4rda5!piezt6b7wj35g(+$mgz52k#d="
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ["*"]
# Application definition
INSTALLED_APPS = (
"django.contrib.contenttypes",
"django.contrib.admin",
# 'django.contrib.admindocs',
"django.contrib.auth",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"django_extensions",
"people",
"location",
"planning",
"objective",
"competition",
"profile",
"tools",
"communication",
"rest_framework",
# 'django_spaghetti',
)
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
#'django.middleware.csrf.CsrfViewMiddleware',
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
#'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = "khana.urls"
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [os.path.join(BASE_DIR, "templates"),],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
"django.template.context_processors.debug",
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
"django.template.context_processors.media",
],
},
},
]
# WSGI_APPLICATION = 'khana.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "khana.db",
"USER": "",
"PASSWORD": "",
"HOST": "", # Or an IP Address that your DB is hosted on
"PORT": "",
}
}
# Internationalization
# https://docs.djangoproject.com/en/1.8/topics/i18n/
# LANGUAGE_CODE = 'fr-FR' # en-US
LANGUAGE_CODE = "en-US"
TIME_ZONE = "UTC"
USE_I18N = True
USE_L10N = True
USE_TZ = False # True
APPEND_SLASH = False # <== a mettre pour mes scripts des listes de présence ???
LOGIN_URL = "/login/"
LOGOUT_URL = "/logout/"
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.8/howto/static-files/
STATIC_URL = "/static/"
STATICFILES_DIRS = (os.path.join(BASE_DIR, "static"),)
MEDIA_URL = "/media/" # https://media.khana.be
MEDIA_ROOT = os.path.join(BASE_DIR, "media")
DEBUG_TOOLBAR_CONFIG = {
"JQUERY_URL": STATIC_URL + "js/jquery-2.1.4.min.js",
}

17
src/khana/settings.py Normal file
View File

@ -0,0 +1,17 @@
import sys
from khana.base_settings import *
# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
if not "test" in sys.argv:
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "khana",
"USER": "root",
"PASSWORD": "PC8/aQy8+w3$",
"HOST": "localhost", # Or an IP Address that your DB is hosted on
"PORT": "3306",
}
}

93
src/khana/urls.py Normal file
View File

@ -0,0 +1,93 @@
"""khana URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Add an import: from blog import urls as blog_urls
2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls))
"""
from django.urls import include, path
from django.conf.urls.static import static
from django.contrib import admin
from khana import settings
import khana.views
import planning.views
import people.views
import objective.views
import location.views
import location.urls
import people.urls
import objective.urls
import planning.urls
import competition.urls
import profile.urls
import communication.urls
# import planningline_urlpatterns
# new makrdown parser : https://github.com/chjj/marked
urlpatterns = [
# Model's design
# url(r'^plate/', include('django_spaghetti.urls')),
# administration
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
path(r"admin/", admin.site.urls),
# url(r'^admin/jsi18n/$', include('django.views.i18n.javascript_catalog')), # pour le "ModelMultipleChoiceField" de event.forms
# Profile list
path(r"profile/", include(profile.urls.profile_urlpatterns)),
# Attendance list
path(r"attendance/", include(planning.urls.attendance_urlpatterns)),
# About competition
path(r"score/", include(competition.urls.score_urlpatterns)),
# About gymnast
path(r"gymnast/", include(people.urls.people_urlpatterns)),
# About event
path(r"event/", include(planning.urls.event_urlpatterns)),
# About skill
path(r"skill/", include(objective.urls.skill_urlpatterns)),
# About chrono
path(r"chrono/", include(objective.urls.chrono_urlpatterns)),
# About skill
path(r"training/", include(planning.urls.training_urlpatterns)),
# About routine
path(r"routine/", include(objective.urls.routine_urlpatterns)),
# About accident
path(r"accident/", include(people.urls.accident_urlpatterns)),
# About unavailability
path(r"unavailability/", include(planning.urls.unavailability_urlpatterns)),
# About planningline
path(r"program/", include(planning.urls.planningline_urlpatterns)),
# About course
path(r"course/", include(planning.urls.course_urlpatterns)),
path(r"message/", include(communication.urls.message_urlpatterns)),
# About Location
path(r"place/", include(location.urls.place_urlpatterns)),
path(r"country/", include(location.urls.country_urlpatterns)),
path(r"club/", include(location.urls.club_urlpatterns)),
# url(r'^club/', location.views.chooseStatistics),
# url(r'^club/(?P<clubid>[0-9]+)', location.views.club_statistics),
# Global search
path(r"search/", khana.views.search, name="global_search"),
# login & logout
path(r"login/", khana.views.login, name="login"),
path(r"logout/", khana.views.logout, name="logout"),
# Home page
path(r"", khana.views.home, name="home"),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
# if settings.DEBUG:
# import debug_toolbar
# urlpatterns.append(
# url(r'^__debug__/', include(debug_toolbar.urls)),
# )

272
src/khana/views.py Normal file
View File

@ -0,0 +1,272 @@
# coding=UTF-8
from django.db.models import Q
from django.shortcuts import render
from django.template import RequestContext
from django.utils import timezone
from django.utils.html import format_html
from django.contrib.auth import authenticate, login as auth_login, logout as auth_logout
from django.http import HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from django.views.decorators.http import require_http_methods
from datetime import datetime, timedelta, date
from functools import reduce
import operator
from planning.models import (
Season,
Event,
Unavailability,
Course,
get_number_of_weeks_between,
)
from people.models import Gymnast, Accident # people model
from location.models import Club # location model
from objective.models import Skill, Routine # objective model
from profile.models import Profile
from communication.views import get_number_unreaded_message
import pendulum
def login(request):
"""
Formulaire d'authentifictation.
"""
club_list = Club.objects.all()
if request.method == "POST":
username = request.POST["login"]
password = request.POST["password"]
user = authenticate(username=username, password=password)
if user is not None: # Pq pas "if user:" ??
if user.is_active:
auth_login(request, user)
try:
profile = Profile.objects.get(user=user)
request.session["profileid"] = profile.id
request.session["template"] = profile.template_color
request.session["sidebar"] = profile.sidebar_color
request.session["is_sidebar_minified"] = profile.is_sidebar_minified
except expression as identifier:
pass
request.session["clubid"] = request.POST.get("clubid", None)
return HttpResponseRedirect("/")
else:
context = {"message": "Account disabled.", "clubs": club_list}
else:
context = {"message": "Wrong login/password.", "clubs": club_list}
else:
context = {"clubs": club_list}
return render(request, "login.html", context)
@login_required
@require_http_methods(["GET"])
def logout(request):
"""
Fonction de déconnexion
"""
auth_logout(request)
return HttpResponseRedirect("/login/")
@login_required
def __getEventInfo(request):
"""
Fonction 'private' qui renvoie les informations relatives à une liste d'évenements.
.. todo:: il refuse mon 'filter' que ce soit avant ou après le 'next(5)'. Une idée ?
next_event = Event.objects.filter(club__in=(request.session["clubid"], )).next(5)
"""
# rest = 0
# counted = 0
# event_list = []
# today = pendulum.now().date()
next_event_list = Event.objects.next(5)
# for event in next_event:
# counted = event.get_number_of_occurence_to_event(today)
# # print('pouf !')
# unavailabilities = Unavailability.objects.filter(datebegin__lte=event.datebegin.date(), dateend__gte=today)
# for unavailable in unavailabilities:
# counted -= unavailable.get_total_occurence()
# event_list.append((event, counted, int((counted/16)*100)))
return next_event_list
@login_required
def __getCourseInfo(request):
"""
Fonction `private` qui renvoie les informations relatives à une liste de cours :
cours, nombre de cours donnés, nombre de cours restant.
"""
rest = 0
counted = 0
courses = []
courses_done = 0
courses_left = 0
today = timezone.now().date()
# CourseList = Course.objects.filter(trainers__in=(request.user, ), club__in=(request.session["clubid"], )).order_by('iso_day_number', 'hour_begin')
CourseList = Course.objects.filter(trainers__in=(request.user,)).order_by(
"iso_day_number", "hour_begin"
)
for course in CourseList:
# Nombre de cours total sur la saison.
counted = course.get_total_occurence()
# Nombre de cours restant (à partir d'aujourd'hui)
rest = course.get_number_of_occurence_inbetween(today, True)
tmp = course.dateend.date() - today
if course.dateend.weekday() <= (today.weekday() + ((tmp.days + 1) % 7) % 7):
rest = int((tmp.days + 1) / 7) + 1
else:
rest = int((tmp.days + 1) / 7)
# # select tous les unavailables liés au cours
# unavailabilities = Unavailability.objects.filter(course=course)
# for unavailable in unavailabilities:
# tmp = unavailable.get_total_occurence()
# counted -= tmp
# rest -= tmp # si un unavailability.date < today, on soustrait quand même de rest ??? Si oui => BUG !!!!
courses_left += rest
courses_done += counted - rest
# courses.append((course, counted, (counted - rest)))
return courses, courses_done, courses_left
@login_required
@require_http_methods(["GET"])
def home(request):
"""Génère la page d'accueil du site basée sur la saison (si celle-ci est
connue)
.. todo:: vérifier s'il y a des élèves qui devait participer à une compé-
tition (passée) pour laquelle il n'y a pas de points encodés. Si c'est le
cas, générer un popup. (le coach doit soit encoder les points soit suppri-
mer la participation de l'élève à l'event)
"""
today = pendulum.today().date()
try:
season = Season.objects.get(datebegin__lte=today, dateend__gte=today)
except Season.DoesNotExist:
context = {"error": "No season founded."}
return render(request, "index.html", context)
except Season.MultipleObjectsReturned:
context = {"error": "Multiple season founded."}
return render(request, "index.html", context)
week_number = season.week_number_from_begin(today)
# Afficher les 3 prochains cours.
weekdays_included = (today.weekday(), today.weekday() + 1, today.weekday() + 2)
courses_list = Course.objects.filter(trainers__in=(request.user,)).order_by(
"iso_day_number", "hour_begin"
)
# enlever les cours s'il sont repris dans des unavalability
event_list = __getEventInfo(request)
unavailable_list = Unavailability.objects.next(5)
birthday_list = next_birthdays(request, 5)
number_unreaded_message = get_number_unreaded_message(request)
courses, courses_done, courses_left = __getCourseInfo(request)
context = {
"week_number": week_number,
"number_of_courses": len(courses_list),
"courses_list": courses_list,
"event_list": event_list,
"birthday_list": birthday_list,
"unavailable_list": unavailable_list,
"courses_left": courses_left,
"donecourses": courses_done,
"today": today,
"number_unreaded_message": number_unreaded_message,
}
return render(request, "index.html", context)
@login_required
def birthdays_within(request, days):
"""
Renvoie la liste des gymnastes ayant leur anniversaires dans les `days` prochains jours.
"""
now = datetime.now()
then = now + timedelta(days)
# Build the list of month/day tuples.
monthdays = [(now.month, now.day)]
while now <= then:
monthdays.append((now.month, now.day))
now += timedelta(days=1)
# Tranform each into queryset keyword args.
monthdays = (
dict(zip(("birthdate__month", "birthdate__day"), t)) for t in monthdays
)
# Compose the djano.db.models.Q objects together for a single query.
query = reduce(operator.or_, (Q(**d) for d in monthdays))
# Run the query.
return Gymnast.objects.filter(query).order_by("birthdate")
@login_required
def next_birthdays(request, number_of_birthday):
"""
Renvoie la liste des `number_of_birthday` prochains anniversaires.
"""
birthday_list = sorted(
Gymnast.objects.all(), key=lambda t: t.next_birthday_in_days
)[:5]
return birthday_list
@login_required
@require_http_methods(["GET"])
def search(request):
"""
Recherche globale au travers de toutes les applications.
"""
pattern = request.GET.get("pattern", None)
if pattern:
event_list = Event.objects.filter(
name__icontains=pattern
) # ou gymnaste qui y participe !
gymnast_list = Gymnast.objects.filter(
Q(lastname__icontains=pattern) | Q(firstname__icontains=pattern)
)
accident_list = Accident.objects.filter(
Q(gymnast__lastname__icontains=pattern)
| Q(gymnast__firstname__icontains=pattern)
)
skill_list = Skill.objects.filter(
Q(longLabel__icontains=pattern) | Q(shortLabel__icontains=pattern)
)
routine_list = Routine.objects.filter(
Q(longLabel__icontains=pattern) | Q(shortLabel__icontains=pattern)
)
context = {
"event_list": event_list,
"gymnast_list": gymnast_list,
"accident_list": accident_list,
"skill_list": skill_list,
"routine_list": routine_list,
}
else:
context = {}
return render(request, "results.html", context)

16
src/khana/wsgi.py Normal file
View File

@ -0,0 +1,16 @@
"""
WSGI config for khana project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "khana.settings")
application = get_wsgi_application()

0
src/location/__init__.py Normal file
View File

35
src/location/admin.py Normal file
View File

@ -0,0 +1,35 @@
from django.contrib import admin
from .models import Place, Club, Country
class CountryAdmin(admin.ModelAdmin):
model = Country
list_display = ("namefr", "nameus", "iso3", "iso2")
ordering = ("namefr",)
search_fields = ("namefr", "nameus", "nationality")
class ClubAdmin(admin.ModelAdmin):
model = Club
list_display = ("name", "acronym", "place", "active")
ordering = ("name",)
list_filter = ("active",)
search_fields = ("name",)
autocomplete_fields = ("place",)
class PlaceAdmin(admin.ModelAdmin):
model = Place
list_display = ("name", "address", "postal", "city", "active")
ordering = ("name",)
list_filter = ("active",)
search_fields = ("name", "address", "postal", "city")
autocomplete_fields = ("country",)
admin.site.register(Place, PlaceAdmin)
admin.site.register(Club, ClubAdmin)
admin.site.register(Country, CountryAdmin)

58
src/location/forms.py Normal file
View File

@ -0,0 +1,58 @@
# coding=UTF-8
from django import forms
from datetime import date
from .models import Place
class PlaceForm(forms.ModelForm):
class Meta:
model = Place
fields = (
"name",
"address",
"postal",
"city",
"country",
"nbkm",
"timing",
"active",
)
widgets = {
"name": forms.TextInput(
attrs={"class": "form-control", "placeholder": "Place's name"}
),
"address": forms.TextInput(
attrs={"class": "form-control", "placeholder": "Address"}
),
"postal": forms.TextInput(
attrs={"class": "form-control", "placeholder": "ZIP Code"}
),
"city": forms.TextInput(
attrs={"class": "form-control", "placeholder": "City"}
),
"country": forms.HiddenInput(),
"nbkm": forms.TextInput(
attrs={"class": "form-control", "placeholder": "Distance"}
),
"timing": forms.TextInput(
attrs={"class": "form-control", "placeholder": "Travel time"}
),
"active": forms.CheckboxInput(
attrs={
"class": "bootstrap-switch pt-2",
"data-on-label": "<i class='tim-icons icon-check-2 text-success'></i>",
"data-off-label": "<i class='tim-icons icon-simple-remove text-danger'></i>",
}
),
}
country_related = forms.CharField(
widget=forms.TextInput(
attrs={
"class": "form-control",
"placeholder": "Searching…",
"data-ref": "#id_country",
}
)
)

View File

@ -0,0 +1,106 @@
# Generated by Django 2.1.7 on 2019-03-16 16:58
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Club",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=255, verbose_name="Name")),
("acronym", models.CharField(max_length=4, verbose_name="Acronym")),
("active", models.BooleanField(default=1, verbose_name="Active")),
],
options={"verbose_name": "Club", "verbose_name_plural": "Clubs",},
),
migrations.CreateModel(
name="Country",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"nameus",
models.CharField(max_length=255, verbose_name="English name"),
),
(
"namefr",
models.CharField(max_length=255, verbose_name="French Name"),
),
(
"nationality",
models.CharField(max_length=255, verbose_name="Nationality"),
),
("iso2", models.CharField(max_length=2)),
("iso3", models.CharField(max_length=3)),
("isonum", models.IntegerField()),
],
options={"verbose_name": "Country", "verbose_name_plural": "Countries",},
),
migrations.CreateModel(
name="Place",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=255, verbose_name="Name")),
("address", models.CharField(max_length=255, verbose_name="Address")),
("postal", models.IntegerField(verbose_name="Postal code")),
("city", models.CharField(max_length=255, verbose_name="City")),
("nbkm", models.IntegerField(blank=True, help_text="in km", null=True)),
(
"timing",
models.IntegerField(blank=True, help_text="in minutes", null=True),
),
("active", models.BooleanField(default=1, verbose_name="Active")),
(
"country",
models.ForeignKey(
default=None,
on_delete=django.db.models.deletion.CASCADE,
to="location.Country",
verbose_name="Country",
),
),
],
options={"verbose_name": "Place", "verbose_name_plural": "Places",},
),
migrations.AddField(
model_name="club",
name="place",
field=models.ForeignKey(
default=None,
on_delete=django.db.models.deletion.CASCADE,
to="location.Place",
verbose_name="Place",
),
),
]

View File

@ -0,0 +1,33 @@
# Generated by Django 2.1.7 on 2019-04-02 20:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("location", "0001_initial"),
]
operations = [
migrations.AlterField(
model_name="country", name="isonum", field=models.PositiveIntegerField(),
),
migrations.AlterField(
model_name="place",
name="nbkm",
field=models.PositiveIntegerField(blank=True, help_text="in km", null=True),
),
migrations.AlterField(
model_name="place",
name="postal",
field=models.PositiveIntegerField(verbose_name="Postal code"),
),
migrations.AlterField(
model_name="place",
name="timing",
field=models.PositiveIntegerField(
blank=True, help_text="in minutes", null=True
),
),
]

View File

@ -0,0 +1,18 @@
# Generated by Django 2.1.7 on 2019-04-02 20:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("location", "0002_auto_20190402_2032"),
]
operations = [
migrations.AlterField(
model_name="country",
name="isonum",
field=models.PositiveSmallIntegerField(),
),
]

View File

73
src/location/models.py Normal file
View File

@ -0,0 +1,73 @@
# coding=UTF-8
from django.db import models
class Country(models.Model):
"""
Classe représentant les pays (basée sur la liste ISO 3166 de 2015).
"""
class Meta:
verbose_name = "Country"
verbose_name_plural = "Countries"
nameus = models.CharField(max_length=255, verbose_name="English name")
namefr = models.CharField(max_length=255, verbose_name="French Name")
nationality = models.CharField(max_length=255, verbose_name="Nationality")
iso2 = models.CharField(max_length=2)
iso3 = models.CharField(max_length=3)
isonum = models.PositiveSmallIntegerField()
def __str__(self):
return "%s (%s)" % (self.namefr, self.iso2)
class Place(models.Model):
"""
Classe représentant un lieu. En plus de l'adresse, un lieu est spécifié par un nombre
de kilomètres et une durée de trajet. Pour faciliter les filtres, un lieu peut être
actif ou non.
"""
class Meta:
verbose_name = "Place"
verbose_name_plural = "Places"
name = models.CharField(max_length=255, verbose_name="Name")
address = models.CharField(max_length=255, verbose_name="Address")
postal = models.PositiveIntegerField(verbose_name="Postal code")
city = models.CharField(max_length=255, verbose_name="City")
country = models.ForeignKey(
Country, verbose_name="Country", on_delete=models.CASCADE, default=None
)
nbkm = models.PositiveIntegerField(blank=True, null=True, help_text="in km")
timing = models.PositiveIntegerField(blank=True, null=True, help_text="in minutes")
active = models.BooleanField(default=1, verbose_name="Active")
def __str__(self):
return "%s (%s)" % (self.name, self.city)
class Club(models.Model):
"""
Classe représentant un club. Un club est associé à un lieu. Pour faciliter les filtres,
un club peut être actif ou non.
.. todo:: Un club peut avoir plusieurs salle et une salle peut-être louée par plusieurs clubs... M2M ?
"""
class Meta:
verbose_name = "Club"
verbose_name_plural = "Clubs"
# place=models.ManyToManyField(Place, through="clubs")
place = models.ForeignKey(
Place, verbose_name="Place", on_delete=models.CASCADE, default=None
)
name = models.CharField(max_length=255, verbose_name="Name")
acronym = models.CharField(max_length=4, verbose_name="Acronym")
active = models.BooleanField(default=1, verbose_name="Active")
def __str__(self):
return "%s%s)" % (self.name, self.place.city)

3
src/location/tests.py Normal file
View File

@ -0,0 +1,3 @@
# from django.test import TestCase
# Create your tests here.

20
src/location/urls.py Normal file
View File

@ -0,0 +1,20 @@
# coding=UTF-8
from django.urls import path
from . import views
place_urlpatterns = [
path(r"lookup/", views.place_lookup),
path(r"country/lookup", views.country_lookup),
path(r"add/", views.place_create_or_update, name="place_create"),
path(r"edit/<int:placeid>/", views.place_create_or_update, name="place_update"),
path(r"<int:placeid>/", views.place_details, name="place_details"),
path(r"", views.place_listing, name="place_list"),
]
country_urlpatterns = [
path(r"lookup/", views.country_lookup),
]
club_urlpatterns = [path(r"", views.chooseStatistics)]

301
src/location/views.py Normal file
View File

@ -0,0 +1,301 @@
# coding=UTF-8
from django.db.models import Q, Count
from django.shortcuts import render, get_object_or_404
from django.template import RequestContext
from django.utils.html import format_html
from django.contrib.auth import authenticate, login as auth_login, logout as auth_logout
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from django.views.decorators.http import require_http_methods
from datetime import datetime, timedelta, date
from functools import reduce
import operator
import simplejson
from planning.models import (
Event,
Unavailability,
Course,
Subgroup,
Training,
) # planning model
from people.models import Gymnast, Accident # people model
from .models import (
Club,
Place,
Country,
)
from .forms import PlaceForm
from objective.models import Skill, Routine # objective model
def __diffTime(end, start):
"""
Prend deux `datetime.time` en paramètre et calcul la différence entre les deux.
"""
startdate = datetime(2000, 1, 1, start.hour, start.minute)
enddate = datetime(2000, 1, 1, end.hour, end.minute)
return enddate - startdate
@login_required
@require_http_methods(["GET"])
def place_lookup(request):
"""
Récupère la liste des lieux à la volée suivant des caractères de recherche entrés.
"""
pattern = request.GET.get("pattern", 0)
if pattern is not None and len(pattern) >= 3:
results = Place.objects.filter(
Q(name__icontains=pattern) | Q(city__icontains=pattern)
)
place_list = [{"ID": x.id, "Label": str(x)} for x in results]
json = simplejson.dumps(place_list)
return HttpResponse(json, content_type="application/json")
@login_required
@require_http_methods(["GET"])
def country_lookup(request):
"""
Récupère la liste des pays à la volée suivant des caractères de recherche entrés.
"""
pattern = request.GET.get("pattern", 0)
if pattern is not None and len(pattern) >= 3:
results = Country.objects.filter(
Q(nameus__icontains=pattern)
| Q(namefr__icontains=pattern)
| Q(nationality__icontains=pattern)
)
country_list = [{"id": x.id, "Label": str(x)} for x in results]
json = simplejson.dumps(country_list)
return HttpResponse(json, content_type="application/json")
@login_required
@require_http_methods(["GET"])
def place_listing(request):
"""
Liste tous les lieux connus
"""
place_list = Place.objects.all()
context = {"place_list": place_list}
return render(request, "place_list.html", context)
@login_required
@require_http_methods(["GET", "POST"])
def place_create_or_update(request, placeid=None):
"""
Formulaire de création d'un nouveau lieu.
"""
if placeid:
place = get_object_or_404(Place, pk=placeid)
data = {"country_related": place.country}
else:
place = None
data = {}
if request.method == "POST":
form = PlaceForm(request.POST, instance=place)
if form.is_valid():
place = form.save()
return HttpResponseRedirect("/place/" + str(place.id) + "/")
else:
form = PlaceForm(instance=place, initial=data)
context = {"form": form, "placeid": placeid}
return render(request, "place_create.html", context)
@login_required
@require_http_methods(["GET"])
def place_details(request, placeid):
"""
Récupère toutes les informations d'un lieu.
"""
place = get_object_or_404(Place, pk=placeid)
context = {"place": place}
return render(request, "place_details.html", context)
@login_required
def chooseStatistics(request):
"""
Renvoie la liste des clubs et des saisons pour que l'utilisateur choisisse quelles statistiques il veut voir.
"""
year = int(request.GET.get("year", date.today().year))
clubid = request.GET.get("clubid", None)
years_list = set(course.datebegin.year for course in Course.objects.all())
club_list = Club.objects.all().order_by("name")
context = {}
if year and clubid:
context = club_statistics(request, (int(clubid),))
context["selectedClubid"] = clubid
context["selectedYear"] = year
context["yearsList"] = years_list
context["clubList"] = club_list
return render(request, "club_statistics.html", context)
@login_required
def club_statistics(request, clubid):
"""
Renvoie les statistiques d'un club pour une saison choisie.
.. todo:: tenir compte de la saison.
"""
courses = Course.objects.filter(club__in=clubid).order_by(
"iso_day_number", "hour_begin"
)
totalHours = 0
totalCourses = 0
totalHoursByWeek = 0
totalHoursPaid = 0
gymnastsDict = {}
gymnasts = []
courseList = []
for course in courses:
nbtrainer = course.trainers.count()
list_of_gymnasts = Gymnast.objects.filter(to_gym__in=course.to_subgroup.all())
gymnasts.extend(list_of_gymnasts)
nbgymnast = len(list_of_gymnasts)
# gymnasts = set(gymnasts.extend(Gymnast.objects.filter(to_gym__in=course.to_subgroup.all())))
nbhour = __diffTime(course.hour_end, course.hour_begin) # timedelta
totalHoursByWeek += nbhour.seconds
counted = course.get_total_occurence()
# select tous les unavailables liés au cours
unavailabilities = Unavailability.objects.filter(course=course)
for unavailable in unavailabilities:
counted -= unavailable.get_total_occurence()
totalCourses += counted
totalTimeForCourse = nbhour * counted # timedelta
totalHourForCourse = (totalTimeForCourse.days * 24) + (
totalTimeForCourse.seconds / 3600
)
totalHours += totalHourForCourse
totalHoursPaidForCourse = totalHourForCourse * nbtrainer
totalHoursPaid += totalHoursPaidForCourse
# tmp = int(nbhour.seconds/3600)
# hour = "%d:%02d" % (tmp, (nbhour.seconds - (tmp * 3600)) / 60)
hour = nbhour.seconds / 3600
courseList.append(
(
course,
nbtrainer,
nbgymnast,
hour,
counted,
totalHourForCourse,
totalHoursPaidForCourse,
)
)
for gymnast in list_of_gymnasts:
# print(gymnast)
if gymnast.id not in gymnastsDict:
gymnastsDict[gymnast.id] = {
"gymnast": gymnast,
"nbcoursebyweek": 0,
"nbhourbyweek": timedelta(),
"nbtraining": 0,
"nbattendance": 0,
"nbabsence": 0,
"nbhourtraining": 0,
"nbhourattendance": timedelta(),
"percentageattendance": 0,
"nbhourabsence": 0,
"percentageabsence": 0,
}
attendanceList = Training.objects.filter(course=course, gymnast=gymnast)
nbattendance = len(attendanceList)
# print(str(gymnast) + ' : ' + str(nbattendance) + ' for ' + str(course) )
gymnastsDict[gymnast.id]["nbcoursebyweek"] += 1
gymnastsDict[gymnast.id]["nbhourbyweek"] += nbhour # timedelta
gymnastsDict[gymnast.id]["nbtraining"] += counted
gymnastsDict[gymnast.id]["nbattendance"] += nbattendance
gymnastsDict[gymnast.id]["nbhourtraining"] += totalHourForCourse
gymnastsDict[gymnast.id]["nbhourattendance"] += (
nbhour * nbattendance
) # timedelta
# print(gymnastsDict[gymnast.id])
# tous les cours ont été traités
totalHoursByWeek = totalHoursByWeek / 3600
gymnasts = set(gymnasts)
# print(gymnasts)
for gymnast in gymnasts:
tmp = int(gymnastsDict[gymnast.id]["nbhourbyweek"].seconds / 3600)
gymnastsDict[gymnast.id]["nbhourbyweek"] = "%d:%02d" % (
tmp,
(gymnastsDict[gymnast.id]["nbhourbyweek"].seconds - (tmp * 3600)) / 60,
)
gymnastsDict[gymnast.id]["nbabsence"] = (
gymnastsDict[gymnast.id]["nbtraining"]
- gymnastsDict[gymnast.id]["nbattendance"]
)
# tmp = (gymnastsDict[gymnast.id]['nbhourattendance'].days * 24) + (gymnastsDict[gymnast.id]['nbhourattendance'].seconds/3600)
gymnastsDict[gymnast.id]["nbhourattendance"] = (
gymnastsDict[gymnast.id]["nbhourattendance"].days * 24
) + (gymnastsDict[gymnast.id]["nbhourattendance"].seconds / 3600)
gymnastsDict[gymnast.id]["nbhourabsence"] = (
gymnastsDict[gymnast.id]["nbhourtraining"]
- gymnastsDict[gymnast.id]["nbhourattendance"]
)
gymnastsDict[gymnast.id]["percentageattendance"] = int(
(
gymnastsDict[gymnast.id]["nbhourattendance"]
/ gymnastsDict[gymnast.id]["nbhourtraining"]
)
* 100
)
gymnastsDict[gymnast.id]["percentageabsence"] = int(
(
gymnastsDict[gymnast.id]["nbhourabsence"]
/ gymnastsDict[gymnast.id]["nbhourtraining"]
)
* 100
)
context = {
"courses": courseList,
"gymnasts": gymnastsDict,
"totalHoursByWeek": totalHoursByWeek,
"totalCourses": totalCourses,
"totalHours": totalHours,
"totalHoursPaid": totalHoursPaid,
}
return context

10
src/manage.py Executable file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "khana.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)

BIN
src/media/Lucasljpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
src/media/Nell_blog.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
src/media/image.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

BIN
src/media/noelia.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

165
src/objective/admin.py Normal file
View File

@ -0,0 +1,165 @@
from django.contrib import admin
# Register your models here.
from .models import (
Educative,
TouchPosition,
Skill,
Routine,
Routine_Skill,
Chrono,
)
from django_extensions.admin import ForeignKeyAutocompleteAdmin
class TouchPositionAdmin(admin.ModelAdmin):
model = TouchPosition
list_display = ("longLabel", "shortLabel", "competition", "default")
ordering = ("longLabel", "shortLabel")
search_fields = ("longLabel", "shortLabel")
list_filter = ("competition",)
def duplicate_skill(self, SkillAdmin, request, queryset):
for object in queryset:
object.id = None
object.save()
class SkillAdmin(ForeignKeyAutocompleteAdmin):
model = Skill
# related_search_fields = {
# 'departure': ('longLabel', 'shortLabel'),
# 'landing': ('longLabel', 'shortLabel')
# }
fields = (
"longLabel",
"shortLabel",
"information",
"departure",
"landing",
"rotationType",
"position",
"rotation",
"twist",
"difficulty",
"level",
"rank",
"notation",
"simplyNotation",
"is_competitive",
"ageBoy",
"ageGirl",
"prerequisite",
"educative",
)
list_display = (
"longLabel",
"difficulty",
"is_competitive",
"level",
"rank",
"notation",
"ageBoy",
"ageGirl",
)
# list_display = ('longLabel', 'shortLabel', 'prerequisite')
ordering = ("longLabel", "shortLabel")
search_fields = ("rank", "longLabel", "shortLabel")
list_filter = (
"is_competitive",
"departure",
"landing",
"rotationType",
"rank",
"rotation",
"level",
"difficulty",
"ageBoy",
"ageGirl",
)
filter_horizontal = ("educative", "prerequisite")
duplicate_skill.short_description = "Duplicate selected record"
class Media:
js = ("js/skill.js",)
class RoutineAdmin(admin.ModelAdmin):
model = Routine
fields = (
"longLabel",
"shortLabel",
"difficulty",
"level",
"rank",
"educative",
"prerequisite",
"ageBoy",
"ageGirl",
"active",
"is_competitive",
)
list_display = (
"longLabel",
"shortLabel",
"is_competitive",
"active",
"level",
"rank",
"difficulty",
)
list_filter = ("level", "difficulty", "is_competitive", "active")
search_fields = (
"longLabel",
"shortLabel",
)
filter_horizontal = ("educative",)
class Media:
js = ("js/routine.js",)
# TODO: ne proposer QUE les SKILL comme educatif
def get_related_filter(self, model, request):
# print('boum')
if not issubclass(model, Educative):
return super(Skill, self).get_related_filter(model, request)
class RoutineSkillAdmin(admin.ModelAdmin):
model = Routine_Skill
list_display = ("routine", "skill", "rank")
search_fields = (
"routine__longLabel",
"routine__shortLabel",
)
ordering = ("routine",)
class ChronoAdmin(ForeignKeyAutocompleteAdmin):
model = Chrono
list_display = ("date", "gymnast", "routine", "score")
# search_fields = ('gymnast', 'routine')
autocomplete_fields = ["gymnast", "routine"]
related_search_fields = {
"gymnast": ("lastname", "firstname"),
"routine": ("longLabel", "shortLabel"),
}
# admin.site.register(Educative) # a commenter je crois
admin.site.register(TouchPosition, TouchPositionAdmin)
admin.site.register(Skill, SkillAdmin)
admin.site.register(Routine, RoutineAdmin)
admin.site.register(Routine_Skill, RoutineSkillAdmin)
admin.site.register(Chrono, ChronoAdmin)

63
src/objective/forms.py Normal file
View File

@ -0,0 +1,63 @@
# coding=UTF-8
from django import forms
from datetime import date
from .models import Routine, Routine_Skill, Chrono
class RoutineForm(forms.ModelForm):
class Meta:
model = Routine
fields = ("longLabel", "shortLabel", "difficulty", "level", "active")
widgets = {
# Champs obligatoires de la classe mère.
"longLabel": forms.TextInput(
attrs={"class": "form-control", "placeholder": "Routine's long name"}
),
"shortLabel": forms.TextInput(
attrs={"class": "form-control", "placeholder": "Routine's short name"}
),
"difficulty": forms.HiddenInput(),
"level": forms.HiddenInput(),
"active": forms.HiddenInput(),
}
class ChronoForm(forms.ModelForm):
class Meta:
model = Chrono
fields = ("routine", "routine_type", "gymnast", "date", "score")
widgets = {
"gymnast": forms.HiddenInput(),
"routine": forms.HiddenInput(),
"routine_type": forms.Select(attrs={"class": "form-control"}),
"date": forms.TextInput(
attrs={
"class": "form-control datepicker",
"placeholder": date.today().strftime("%Y-%m-%d"),
"value": date.today().strftime("%Y-%m-%d"),
}
),
"score": forms.TextInput(
attrs={"class": "form-control", "placeholder": "xx,xx"}
),
}
gymnast_related = forms.CharField(
widget=forms.TextInput(
attrs={
"class": "form-control",
"placeholder": "Searching gymnast…",
"data-ref": "#id_gymnast",
}
)
)
routine_related = forms.CharField(
widget=forms.TextInput(
attrs={
"class": "form-control",
"placeholder": "Searching routine…",
"data-ref": "#id_routine",
}
)
)

View File

@ -0,0 +1,227 @@
# Generated by Django 2.1.7 on 2019-03-16 16:58
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Chrono",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"routineType",
models.IntegerField(
choices=[
(0, "Routine 1"),
(1, "Routine 2"),
(2, "Final's routine"),
(3, "10 Chandelles"),
]
),
),
(
"date",
models.DateField(default=datetime.date.today, verbose_name="Date"),
),
("score", models.DecimalField(decimal_places=2, max_digits=5)),
],
),
migrations.CreateModel(
name="Educative",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"information",
models.TextField(
blank=True,
help_text="Seul le MarkDown simple est accepté",
null=True,
verbose_name="Comments",
),
),
(
"longLabel",
models.CharField(max_length=255, verbose_name="Long Name"),
),
(
"shortLabel",
models.CharField(max_length=255, verbose_name="Short Name"),
),
(
"difficulty",
models.DecimalField(
decimal_places=1, max_digits=3, verbose_name="Difficulty"
),
),
("level", models.IntegerField(verbose_name="Level")),
(
"rank",
models.IntegerField(blank=True, null=True, verbose_name="Rank"),
),
(
"ageBoy",
models.IntegerField(
blank=True, null=True, verbose_name="Boy's age"
),
),
(
"ageGirl",
models.IntegerField(
blank=True, null=True, verbose_name="Girl's age"
),
),
],
options={
"verbose_name": "Educatif",
"verbose_name_plural": "Educatifs",
"ordering": ["level", "longLabel", "shortLabel"],
},
),
migrations.CreateModel(
name="Routine_Skill",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("rank", models.IntegerField()),
],
),
migrations.CreateModel(
name="TouchPosition",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("longLabel", models.CharField(max_length=30, verbose_name="Nom long")),
(
"shortLabel",
models.CharField(max_length=15, verbose_name="Nom court"),
),
("competition", models.BooleanField(verbose_name="Compétition")),
("default", models.BooleanField(verbose_name="Défaut")),
],
options={
"verbose_name": "Landing",
"verbose_name_plural": "Landings",
"ordering": ["longLabel", "shortLabel", "default", "competition"],
},
),
migrations.CreateModel(
name="Routine",
fields=[
(
"educative_ptr",
models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="objective.Educative",
),
),
("active", models.BooleanField()),
("is_competitive", models.BooleanField(default=False)),
],
options={"verbose_name": "Routine", "verbose_name_plural": "Routines",},
bases=("objective.educative",),
),
migrations.CreateModel(
name="Skill",
fields=[
(
"educative_ptr",
models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="objective.Educative",
),
),
(
"position",
models.CharField(
choices=[
("0", "None"),
("o", "Tuck"),
("c", "Puck"),
("<", "Pike"),
("L", "Half pike"),
("/", "Straight"),
("//", "Straddle"),
],
max_length=2,
),
),
(
"rotationType",
models.IntegerField(
choices=[(0, "None"), (1, "Frontward"), (2, "Backward")],
verbose_name="Type de rotation",
),
),
("rotation", models.IntegerField(verbose_name="1/4 de rotation")),
("twist", models.IntegerField(verbose_name="1/2 Vrille")),
("notation", models.CharField(max_length=25)),
(
"simplyNotation",
models.CharField(max_length=25, verbose_name="Notation simplifiée"),
),
("is_competitive", models.BooleanField(default=False)),
],
options={"verbose_name": "Skill", "verbose_name_plural": "Skills",},
bases=("objective.educative",),
),
migrations.AddField(
model_name="educative",
name="educative",
field=models.ManyToManyField(
blank=True, related_name="educativeOf", to="objective.Educative"
),
),
migrations.AddField(
model_name="educative",
name="prerequisite",
field=models.ManyToManyField(
blank=True, related_name="prerequisiteOf", to="objective.Educative"
),
),
]

View File

@ -0,0 +1,85 @@
# Generated by Django 2.1.7 on 2019-03-16 16:58
from django.db import migrations, models
import django.db.models.deletion
import objective.models
class Migration(migrations.Migration):
initial = True
dependencies = [
("objective", "0001_initial"),
("people", "0001_initial"),
]
operations = [
migrations.AddField(
model_name="chrono",
name="gymnast",
field=models.ForeignKey(
default=None,
on_delete=django.db.models.deletion.CASCADE,
to="people.Gymnast",
),
),
migrations.AddField(
model_name="skill",
name="departure",
field=models.ForeignKey(
default=objective.models.get_default_position,
on_delete=django.db.models.deletion.CASCADE,
related_name="depart_of",
to="objective.TouchPosition",
verbose_name="Take-off position",
),
),
migrations.AddField(
model_name="skill",
name="landing",
field=models.ForeignKey(
default=objective.models.get_default_position,
on_delete=django.db.models.deletion.CASCADE,
related_name="landing_of",
to="objective.TouchPosition",
verbose_name="Landing position",
),
),
migrations.AddField(
model_name="routine_skill",
name="routine",
field=models.ForeignKey(
default=None,
on_delete=django.db.models.deletion.CASCADE,
to="objective.Routine",
),
),
migrations.AddField(
model_name="routine_skill",
name="skill",
field=models.ForeignKey(
default=None,
on_delete=django.db.models.deletion.CASCADE,
to="objective.Skill",
),
),
migrations.AddField(
model_name="routine",
name="jumps",
field=models.ManyToManyField(
through="objective.Routine_Skill",
to="objective.Skill",
verbose_name="Figures",
),
),
migrations.AddField(
model_name="chrono",
name="routine",
field=models.ForeignKey(
default=None,
on_delete=django.db.models.deletion.CASCADE,
to="objective.Routine",
),
),
]

Some files were not shown because too many files have changed in this diff Show More