Compare commits
No commits in common. "main" and "propal/planning" have entirely different histories.
main
...
propal/pla
49
.pylintrc
49
.pylintrc
|
@ -3,22 +3,17 @@
|
||||||
# A comma-separated list of package or module names from where C extensions may
|
# A comma-separated list of package or module names from where C extensions may
|
||||||
# be loaded. Extensions are loading into the active Python interpreter and may
|
# be loaded. Extensions are loading into the active Python interpreter and may
|
||||||
# run arbitrary code.
|
# run arbitrary code.
|
||||||
extension-pkg-allow-list=
|
|
||||||
|
|
||||||
# A comma-separated list of package or module names from where C extensions may
|
|
||||||
# be loaded. Extensions are loading into the active Python interpreter and may
|
|
||||||
# run arbitrary code. (This is an alternative name to extension-pkg-allow-list
|
|
||||||
# for backward compatibility.)
|
|
||||||
extension-pkg-whitelist=
|
extension-pkg-whitelist=
|
||||||
|
|
||||||
# Specify a score threshold to be exceeded before program exits with error.
|
# Specify a score threshold to be exceeded before program exits with error.
|
||||||
fail-under=10.0
|
fail-under=10.0
|
||||||
|
|
||||||
# Files or directories to be skipped. They should be base names, not paths.
|
# Add files or directories to the blacklist. They should be base names, not
|
||||||
|
# paths.
|
||||||
ignore=CVS
|
ignore=CVS
|
||||||
|
|
||||||
# Files or directories matching the regex patterns are skipped. The regex
|
# Add files or directories matching the regex patterns to the blacklist. The
|
||||||
# matches against base names, not paths.
|
# regex matches against base names, not paths.
|
||||||
ignore-patterns=
|
ignore-patterns=
|
||||||
|
|
||||||
# Python code to execute, usually for sys.path manipulation such as
|
# Python code to execute, usually for sys.path manipulation such as
|
||||||
|
@ -186,7 +181,7 @@ max-nested-blocks=5
|
||||||
# inconsistent-return-statements if a never returning function is called then
|
# inconsistent-return-statements if a never returning function is called then
|
||||||
# it will be considered as an explicit return statement and no message will be
|
# it will be considered as an explicit return statement and no message will be
|
||||||
# printed.
|
# printed.
|
||||||
never-returning-functions=sys.exit,argparse.parse_error
|
never-returning-functions=sys.exit
|
||||||
|
|
||||||
|
|
||||||
[STRING]
|
[STRING]
|
||||||
|
@ -232,8 +227,6 @@ single-line-if-stmt=no
|
||||||
|
|
||||||
[VARIABLES]
|
[VARIABLES]
|
||||||
|
|
||||||
django-settings-module=config.settings
|
|
||||||
|
|
||||||
# List of additional names supposed to be defined in builtins. Remember that
|
# List of additional names supposed to be defined in builtins. Remember that
|
||||||
# you should avoid defining new builtins when possible.
|
# you should avoid defining new builtins when possible.
|
||||||
additional-builtins=
|
additional-builtins=
|
||||||
|
@ -241,9 +234,6 @@ additional-builtins=
|
||||||
# Tells whether unused global variables should be treated as a violation.
|
# Tells whether unused global variables should be treated as a violation.
|
||||||
allow-global-unused-variables=yes
|
allow-global-unused-variables=yes
|
||||||
|
|
||||||
# List of names allowed to shadow builtins
|
|
||||||
allowed-redefined-builtins=
|
|
||||||
|
|
||||||
# List of strings which can identify a callback function by name. A callback
|
# List of strings which can identify a callback function by name. A callback
|
||||||
# name must start or end with one of those strings.
|
# name must start or end with one of those strings.
|
||||||
callbacks=cb_,
|
callbacks=cb_,
|
||||||
|
@ -377,13 +367,6 @@ class-attribute-naming-style=any
|
||||||
# attribute-naming-style.
|
# attribute-naming-style.
|
||||||
#class-attribute-rgx=
|
#class-attribute-rgx=
|
||||||
|
|
||||||
# Naming style matching correct class constant names.
|
|
||||||
class-const-naming-style=UPPER_CASE
|
|
||||||
|
|
||||||
# Regular expression matching correct class constant names. Overrides class-
|
|
||||||
# const-naming-style.
|
|
||||||
#class-const-rgx=
|
|
||||||
|
|
||||||
# Naming style matching correct class names.
|
# Naming style matching correct class names.
|
||||||
class-naming-style=PascalCase
|
class-naming-style=PascalCase
|
||||||
|
|
||||||
|
@ -472,13 +455,9 @@ variable-naming-style=snake_case
|
||||||
max-spelling-suggestions=4
|
max-spelling-suggestions=4
|
||||||
|
|
||||||
# Spelling dictionary name. Available dictionaries: none. To make it work,
|
# Spelling dictionary name. Available dictionaries: none. To make it work,
|
||||||
# install the 'python-enchant' package.
|
# install the python-enchant package.
|
||||||
spelling-dict=
|
spelling-dict=
|
||||||
|
|
||||||
# List of comma separated words that should be considered directives if they
|
|
||||||
# appear and the beginning of a comment and should not be checked.
|
|
||||||
spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:
|
|
||||||
|
|
||||||
# List of comma separated words that should not be checked.
|
# List of comma separated words that should not be checked.
|
||||||
spelling-ignore-words=
|
spelling-ignore-words=
|
||||||
|
|
||||||
|
@ -540,9 +519,6 @@ min-public-methods=2
|
||||||
|
|
||||||
[CLASSES]
|
[CLASSES]
|
||||||
|
|
||||||
# Warn about protected attribute access inside special methods
|
|
||||||
check-protected-access-in-special-methods=no
|
|
||||||
|
|
||||||
# List of method names used to declare (i.e. assign) instance attributes.
|
# List of method names used to declare (i.e. assign) instance attributes.
|
||||||
defining-attr-methods=__init__,
|
defining-attr-methods=__init__,
|
||||||
__new__,
|
__new__,
|
||||||
|
@ -581,17 +557,16 @@ analyse-fallback-blocks=no
|
||||||
# Deprecated modules which should not be used, separated by a comma.
|
# Deprecated modules which should not be used, separated by a comma.
|
||||||
deprecated-modules=optparse,tkinter.tix
|
deprecated-modules=optparse,tkinter.tix
|
||||||
|
|
||||||
# Output a graph (.gv or any supported image format) of external dependencies
|
# Create a graph of external dependencies in the given file (report RP0402 must
|
||||||
# to the given file (report RP0402 must not be disabled).
|
# not be disabled).
|
||||||
ext-import-graph=
|
ext-import-graph=
|
||||||
|
|
||||||
# Output a graph (.gv or any supported image format) of all (i.e. internal and
|
# Create a graph of every (i.e. internal and external) dependencies in the
|
||||||
# external) dependencies to the given file (report RP0402 must not be
|
# given file (report RP0402 must not be disabled).
|
||||||
# disabled).
|
|
||||||
import-graph=
|
import-graph=
|
||||||
|
|
||||||
# Output a graph (.gv or any supported image format) of internal dependencies
|
# Create a graph of internal dependencies in the given file (report RP0402 must
|
||||||
# to the given file (report RP0402 must not be disabled).
|
# not be disabled).
|
||||||
int-import-graph=
|
int-import-graph=
|
||||||
|
|
||||||
# Force import order to recognize a module as part of the standard
|
# Force import order to recognize a module as part of the standard
|
||||||
|
|
14
Makefile
14
Makefile
|
@ -1,14 +0,0 @@
|
||||||
# Makefile for khana
|
|
||||||
|
|
||||||
ifeq ($(shell which coverage >/dev/null 2>&1; echo $$?), 1)
|
|
||||||
$(error The 'coverage' command was not found. Make sure you have coverage installed)
|
|
||||||
endif
|
|
||||||
|
|
||||||
.PHONY: help coverage
|
|
||||||
|
|
||||||
help:
|
|
||||||
@echo " coverage to run coverage check of the source files."
|
|
||||||
|
|
||||||
coverage:
|
|
||||||
coverage run --source='.' manage.py test; coverage report; coverage html;
|
|
||||||
@echo "Testing of coverage in the sources finished."
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Gestion de Gymnastes
|
# 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.
|
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)
|
(plus d'information à venir)
|
||||||
|
|
||||||
|
@ -63,4 +63,4 @@ Ce module permet de gérer les compétitions. (plus d'informations à venir)
|
||||||
|
|
||||||
## Personnes
|
## Personnes
|
||||||
|
|
||||||
Ce module permet de gérer les personnes. (plus d'informations à venir)
|
Ce module permet de gérer les personnes. (plus d'informations à venir)
|
|
@ -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 */;
|
|
@ -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 */;
|
|
@ -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 */;
|
||||||
|
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -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"
|
|
|
@ -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 */;
|
|
@ -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,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
|
|
@ -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
|
|
@ -0,0 +1,6 @@
|
||||||
|
Gymnastes
|
||||||
|
=========
|
||||||
|
|
||||||
|
.. autoclass:: people.models.Gymnast
|
||||||
|
:members:
|
||||||
|
|
|
@ -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`
|
||||||
|
|
|
@ -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."
|
|
@ -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
|
|
@ -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:
|
|
@ -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`
|
||||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -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:
|
|
@ -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:
|
|
@ -1,63 +0,0 @@
|
||||||
# Generated by Django 3.2.2 on 2021-05-13 10:58
|
|
||||||
|
|
||||||
from django.conf import settings
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
||||||
("communication", "0002_auto_20190413_1028"),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="message", old_name="message_body", new_name="body",
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="message", old_name="date_of_reading", new_name="read_at",
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="message", old_name="message_title", new_name="title",
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="message", old_name="date_of_writing", new_name="written_at",
|
|
||||||
),
|
|
||||||
migrations.RemoveField(model_name="message", name="is_read",),
|
|
||||||
migrations.RemoveField(model_name="message", name="reader",),
|
|
||||||
migrations.RemoveField(model_name="message", name="writer",),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name="message",
|
|
||||||
name="content",
|
|
||||||
field=models.TextField(
|
|
||||||
blank=True,
|
|
||||||
help_text="Seul le MarkDown simple est accepté",
|
|
||||||
null=True,
|
|
||||||
verbose_name="Comments",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name="message",
|
|
||||||
name="recipient",
|
|
||||||
field=models.ForeignKey(
|
|
||||||
default=1,
|
|
||||||
on_delete=django.db.models.deletion.CASCADE,
|
|
||||||
related_name="received_messages",
|
|
||||||
to="auth.user",
|
|
||||||
),
|
|
||||||
preserve_default=False,
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name="message",
|
|
||||||
name="sender",
|
|
||||||
field=models.ForeignKey(
|
|
||||||
default=1,
|
|
||||||
on_delete=django.db.models.deletion.CASCADE,
|
|
||||||
related_name="sent_messages",
|
|
||||||
to="auth.user",
|
|
||||||
),
|
|
||||||
preserve_default=False,
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,19 +0,0 @@
|
||||||
"""Tests liés au modèle de l'application Communication"""
|
|
||||||
|
|
||||||
from datetime import datetime
|
|
||||||
|
|
||||||
from django.contrib.auth import get_user_model
|
|
||||||
|
|
||||||
from .models import Message
|
|
||||||
|
|
||||||
|
|
||||||
User = get_user_model()
|
|
||||||
|
|
||||||
|
|
||||||
def test_message_to_string():
|
|
||||||
"""Vérifie la représentation textuelle d'un message
|
|
||||||
"""
|
|
||||||
timing = datetime.now()
|
|
||||||
user = User(username="fred", password="fredpassword")
|
|
||||||
message = Message(sender=user, written_at=timing, title="test")
|
|
||||||
assert str(message) == "fred - " + str(timing) + " : test"
|
|
|
@ -1,5 +0,0 @@
|
||||||
from django.apps import AppConfig
|
|
||||||
|
|
||||||
|
|
||||||
class CompetitionConfig(AppConfig):
|
|
||||||
name = "khana.competition"
|
|
|
@ -1,5 +0,0 @@
|
||||||
from django.apps import AppConfig
|
|
||||||
|
|
||||||
|
|
||||||
class LocationConfig(AppConfig):
|
|
||||||
name = "khana.location"
|
|
|
@ -1,43 +0,0 @@
|
||||||
"""Tests liés au modèle des localisations, places, etc."""
|
|
||||||
|
|
||||||
from django.test import TestCase
|
|
||||||
|
|
||||||
from ..models import Club, Country, Place
|
|
||||||
|
|
||||||
|
|
||||||
class TestCountry(TestCase):
|
|
||||||
def test_str_should_contain_name_and_iso2(self):
|
|
||||||
country = Country.objects.create(
|
|
||||||
nameus="Belgium", namefr="Belgique", isonum=56, iso2="BE"
|
|
||||||
)
|
|
||||||
|
|
||||||
self.assertEqual(str(country), "Belgique (BE)")
|
|
||||||
|
|
||||||
|
|
||||||
class TestPlace(TestCase):
|
|
||||||
def test_str_should_contain_name_and_city(self):
|
|
||||||
place = Place.objects.create(
|
|
||||||
name="Heaven",
|
|
||||||
postal=1080,
|
|
||||||
country=Country.objects.create(
|
|
||||||
nameus="Belgium", namefr="Belgique", isonum=56, iso2="BE"
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
self.assertEqual(str(place), "Heaven (?)")
|
|
||||||
|
|
||||||
|
|
||||||
class TestClub(TestCase):
|
|
||||||
def test_str_should_contain_name_and_location(self):
|
|
||||||
club = Club.objects.create(
|
|
||||||
name="RSCA",
|
|
||||||
place=Place.objects.create(
|
|
||||||
name="Heaven",
|
|
||||||
postal=1080,
|
|
||||||
country=Country.objects.create(
|
|
||||||
nameus="Belgium", namefr="Belgique", isonum=56, iso2="BE"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
self.assertEqual(str(club), "RSCA (à ?)")
|
|
|
@ -1,5 +0,0 @@
|
||||||
from django.apps import AppConfig
|
|
||||||
|
|
||||||
|
|
||||||
class ObjectiveConfig(AppConfig):
|
|
||||||
name = "khana.objective"
|
|
|
@ -1,75 +0,0 @@
|
||||||
# Generated by Django 3.2.2 on 2021-06-20 16:18
|
|
||||||
|
|
||||||
from django.db import migrations
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
("objective", "0016_rename_information_educative_content"),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.RenameModel(old_name="Routine_Skill", new_name="RoutineSkill",),
|
|
||||||
migrations.AlterModelOptions(
|
|
||||||
name="educative",
|
|
||||||
options={
|
|
||||||
"ordering": ["label", "short_label"],
|
|
||||||
"verbose_name": "Educatif",
|
|
||||||
"verbose_name_plural": "Educatifs",
|
|
||||||
},
|
|
||||||
),
|
|
||||||
migrations.AlterModelOptions(
|
|
||||||
name="touchposition",
|
|
||||||
options={
|
|
||||||
"ordering": [
|
|
||||||
"label",
|
|
||||||
"short_label",
|
|
||||||
"is_default",
|
|
||||||
"allowed_in_competition",
|
|
||||||
],
|
|
||||||
"verbose_name": "Landing",
|
|
||||||
"verbose_name_plural": "Landings",
|
|
||||||
},
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="educative", old_name="ageBoy", new_name="age_boy",
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="educative", old_name="ageGirl", new_name="age_girl",
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="educative", old_name="educative", new_name="educatives",
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="educative", old_name="longLabel", new_name="label",
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="educative", old_name="prerequisite", new_name="prerequisites",
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="educative", old_name="shortLabel", new_name="short_label",
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="skill", old_name="rotationType", new_name="rotation_type",
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="skill",
|
|
||||||
old_name="simplyNotation",
|
|
||||||
new_name="simplified_notation",
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="touchposition",
|
|
||||||
old_name="competition",
|
|
||||||
new_name="allowed_in_competition",
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="touchposition", old_name="default", new_name="is_default",
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="touchposition", old_name="longLabel", new_name="label",
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="touchposition", old_name="shortLabel", new_name="short_label",
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,22 +0,0 @@
|
||||||
# Generated by Django 3.2.8 on 2021-12-05 11:33
|
|
||||||
|
|
||||||
from django.db import migrations
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('objective', '0017_auto_20210620_1618'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AlterModelOptions(
|
|
||||||
name='educative',
|
|
||||||
options={'ordering': ['long_label', 'short_label'], 'verbose_name': 'Educatif', 'verbose_name_plural': 'Educatifs'},
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name='educative',
|
|
||||||
old_name='label',
|
|
||||||
new_name='long_label',
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,53 +0,0 @@
|
||||||
# Generated by Django 4.0.1 on 2022-01-13 21:01
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('objective', '0018_auto_20211205_1133'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='educative',
|
|
||||||
name='age_boy_chained',
|
|
||||||
field=models.PositiveSmallIntegerField(choices=[(6, '6-7'), (7, '7-8'), (8, '8-9'), (9, '9-10'), (10, '10-11'), (11, '11-12'), (12, '12-13'), (13, '13-14'), (14, '14-15'), (15, '15-16'), (16, '16-17'), (17, '17+')], default=6, verbose_name="Boy's age chained"),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='educative',
|
|
||||||
name='age_boy_masterised',
|
|
||||||
field=models.PositiveSmallIntegerField(choices=[(6, '6-7'), (7, '7-8'), (8, '8-9'), (9, '9-10'), (10, '10-11'), (11, '11-12'), (12, '12-13'), (13, '13-14'), (14, '14-15'), (15, '15-16'), (16, '16-17'), (17, '17+')], default=6, verbose_name="Boy's age masterised"),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='educative',
|
|
||||||
name='age_boy_with_help',
|
|
||||||
field=models.PositiveSmallIntegerField(choices=[(6, '6-7'), (7, '7-8'), (8, '8-9'), (9, '9-10'), (10, '10-11'), (11, '11-12'), (12, '12-13'), (13, '13-14'), (14, '14-15'), (15, '15-16'), (16, '16-17'), (17, '17+')], default=6, verbose_name="Boy's age with help"),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='educative',
|
|
||||||
name='age_boy_without_help',
|
|
||||||
field=models.PositiveSmallIntegerField(choices=[(6, '6-7'), (7, '7-8'), (8, '8-9'), (9, '9-10'), (10, '10-11'), (11, '11-12'), (12, '12-13'), (13, '13-14'), (14, '14-15'), (15, '15-16'), (16, '16-17'), (17, '17+')], default=6, verbose_name="Boy's age without help"),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='educative',
|
|
||||||
name='age_girl_chained',
|
|
||||||
field=models.PositiveSmallIntegerField(choices=[(6, '6-7'), (7, '7-8'), (8, '8-9'), (9, '9-10'), (10, '10-11'), (11, '11-12'), (12, '12-13'), (13, '13-14'), (14, '14-15'), (15, '15-16'), (16, '16-17'), (17, '17+')], default=6, verbose_name="Girl's age chained"),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='educative',
|
|
||||||
name='age_girl_masterised',
|
|
||||||
field=models.PositiveSmallIntegerField(choices=[(6, '6-7'), (7, '7-8'), (8, '8-9'), (9, '9-10'), (10, '10-11'), (11, '11-12'), (12, '12-13'), (13, '13-14'), (14, '14-15'), (15, '15-16'), (16, '16-17'), (17, '17+')], default=6, verbose_name="Girl's age masterised"),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='educative',
|
|
||||||
name='age_girl_with_help',
|
|
||||||
field=models.PositiveSmallIntegerField(choices=[(6, '6-7'), (7, '7-8'), (8, '8-9'), (9, '9-10'), (10, '10-11'), (11, '11-12'), (12, '12-13'), (13, '13-14'), (14, '14-15'), (15, '15-16'), (16, '16-17'), (17, '17+')], default=6, verbose_name="Girl's age with help"),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='educative',
|
|
||||||
name='age_girl_without_help',
|
|
||||||
field=models.PositiveSmallIntegerField(choices=[(6, '6-7'), (7, '7-8'), (8, '8-9'), (9, '9-10'), (10, '10-11'), (11, '11-12'), (12, '12-13'), (13, '13-14'), (14, '14-15'), (15, '15-16'), (16, '16-17'), (17, '17+')], default=6, verbose_name="Girl's age without help"),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,124 +0,0 @@
|
||||||
"""Administration des gymnastes et des personnes.
|
|
||||||
|
|
||||||
Remarks:
|
|
||||||
* Je ne pense pas qu'il faille encore passer par `ForeignKeyAutocompleteAdmin`.
|
|
||||||
https://docs.djangoproject.com/fr/3.1/ref/contrib/admin/#django.contrib.admin.ModelAdmin.autocomplete_fields
|
|
||||||
"""
|
|
||||||
|
|
||||||
from django.contrib import admin
|
|
||||||
|
|
||||||
from django_extensions.admin import ForeignKeyAutocompleteAdmin
|
|
||||||
|
|
||||||
from .models import (
|
|
||||||
Gymnast,
|
|
||||||
Accident,
|
|
||||||
CanDoRelation,
|
|
||||||
ToDoRelation,
|
|
||||||
GymnastHasRoutine,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class CanDoRelationAdmin(ForeignKeyAutocompleteAdmin):
|
|
||||||
model = CanDoRelation
|
|
||||||
|
|
||||||
list_display = ("date", "gymnast", "educative")
|
|
||||||
list_filter = ("gymnast",)
|
|
||||||
search_fields = ("gymnast", "educative")
|
|
||||||
autocomplete_fields = ("gymnast",)
|
|
||||||
|
|
||||||
# related_search_fields = {
|
|
||||||
# 'gymnast': ('lastname', 'firstname'),
|
|
||||||
# }
|
|
||||||
|
|
||||||
|
|
||||||
class InlineCanDoRelation(admin.TabularInline):
|
|
||||||
model = CanDoRelation
|
|
||||||
|
|
||||||
|
|
||||||
class ToDoRelationAdmin(ForeignKeyAutocompleteAdmin):
|
|
||||||
model = ToDoRelation
|
|
||||||
|
|
||||||
list_display = ("date", "gymnast", "educative")
|
|
||||||
list_filter = ("gymnast",)
|
|
||||||
search_fields = ("gymnast", "educative")
|
|
||||||
autocomplete_fields = ("gymnast",)
|
|
||||||
|
|
||||||
# related_search_fields = {
|
|
||||||
# 'gymnast': ('lastname', 'firstname'),
|
|
||||||
# # 'educative': ('longLabel', 'shortLabel'), # TO_FRED : Pq ca marche pas ca ?
|
|
||||||
# }
|
|
||||||
|
|
||||||
|
|
||||||
class GymnastHasRoutineAdmin(ForeignKeyAutocompleteAdmin):
|
|
||||||
model = GymnastHasRoutine
|
|
||||||
|
|
||||||
list_display = ("gymnast", "routine", "routine_type", "datebegin", "dateend")
|
|
||||||
list_filter = ("gymnast", "routine_type")
|
|
||||||
search_fields = ("gymnast", "routine")
|
|
||||||
autocomplete_fields = ("gymnast", "routine")
|
|
||||||
|
|
||||||
|
|
||||||
class InlineToDoRelation(admin.TabularInline):
|
|
||||||
model = ToDoRelation
|
|
||||||
|
|
||||||
|
|
||||||
class GymnastAdmin(admin.ModelAdmin):
|
|
||||||
model = Gymnast
|
|
||||||
|
|
||||||
def lastname(self, obj):
|
|
||||||
return obj.user.last_name
|
|
||||||
|
|
||||||
def firstname(self, obj):
|
|
||||||
return obj.user.first_name
|
|
||||||
|
|
||||||
def email(self, obj):
|
|
||||||
return obj.user.email
|
|
||||||
|
|
||||||
def is_active(self, obj):
|
|
||||||
return obj.user.is_active
|
|
||||||
|
|
||||||
fields = (
|
|
||||||
"user",
|
|
||||||
"birthdate",
|
|
||||||
"gender",
|
|
||||||
"club",
|
|
||||||
"niss",
|
|
||||||
"address",
|
|
||||||
"postal",
|
|
||||||
"city",
|
|
||||||
"phone",
|
|
||||||
"gsm",
|
|
||||||
"federation_id",
|
|
||||||
"year_of_practice",
|
|
||||||
"gsm_main_responsible",
|
|
||||||
"email_main_responsible",
|
|
||||||
"gsm_second_responsible",
|
|
||||||
"email_second_responsible",
|
|
||||||
"orientation",
|
|
||||||
"trainer",
|
|
||||||
"picture",
|
|
||||||
"content",
|
|
||||||
)
|
|
||||||
|
|
||||||
list_display = ("lastname", "firstname", "birthdate", "age", "is_active")
|
|
||||||
list_filter = ("gender", "user__is_active")
|
|
||||||
search_fields = ("lastname", "firstname", "email")
|
|
||||||
inlines = [InlineToDoRelation, InlineCanDoRelation]
|
|
||||||
autocomplete_fields = ("club",)
|
|
||||||
|
|
||||||
|
|
||||||
class AccidentAdmin(admin.ModelAdmin):
|
|
||||||
model = Accident
|
|
||||||
|
|
||||||
fields = ("date", "gymnast", "educative", "information")
|
|
||||||
list_display = ("date", "gymnast", "educative")
|
|
||||||
list_filter = ("date",)
|
|
||||||
search_fields = ("date", "gymnast", "educative")
|
|
||||||
autocomplete_fields = ["gymnast", "educative"]
|
|
||||||
|
|
||||||
|
|
||||||
admin.site.register(Gymnast, GymnastAdmin)
|
|
||||||
admin.site.register(Accident, AccidentAdmin)
|
|
||||||
admin.site.register(CanDoRelation, CanDoRelationAdmin)
|
|
||||||
admin.site.register(ToDoRelation, ToDoRelationAdmin)
|
|
||||||
admin.site.register(GymnastHasRoutine, GymnastHasRoutineAdmin)
|
|
|
@ -1,5 +0,0 @@
|
||||||
from django.apps import AppConfig
|
|
||||||
|
|
||||||
|
|
||||||
class PeopleConfig(AppConfig):
|
|
||||||
name = "khana.people"
|
|
|
@ -1,175 +0,0 @@
|
||||||
"""Formulaires de gestion des données entrantes pour les gymnastes et accidents."""
|
|
||||||
|
|
||||||
from django import forms
|
|
||||||
from django.contrib.auth import get_user_model
|
|
||||||
|
|
||||||
from .models import (
|
|
||||||
Accident,
|
|
||||||
Gymnast,
|
|
||||||
GymnastHasRoutine,
|
|
||||||
)
|
|
||||||
|
|
||||||
User = get_user_model()
|
|
||||||
|
|
||||||
|
|
||||||
class AccidentForm(forms.ModelForm):
|
|
||||||
class Meta:
|
|
||||||
model = Accident
|
|
||||||
fields = ("gymnast", "educative", "date", "content")
|
|
||||||
widgets = {
|
|
||||||
"date": forms.DateInput(
|
|
||||||
attrs={
|
|
||||||
"class": "form-control datepicker",
|
|
||||||
# "value": date.today().strftime("%Y-%m-%d"),
|
|
||||||
}
|
|
||||||
),
|
|
||||||
"gymnast": forms.HiddenInput(),
|
|
||||||
"educative": forms.HiddenInput(),
|
|
||||||
"content": forms.Textarea(
|
|
||||||
attrs={
|
|
||||||
"class": "form-control",
|
|
||||||
"placeholder": "Informations about accident: context (why, where, …), consequencies, …",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
}
|
|
||||||
|
|
||||||
gymnast_related = forms.CharField(
|
|
||||||
widget=forms.TextInput(
|
|
||||||
attrs={
|
|
||||||
"class": "form-control",
|
|
||||||
"placeholder": "Searching gymnast…",
|
|
||||||
"data-ref": "#id_gymnast",
|
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
educative_related = forms.CharField(
|
|
||||||
widget=forms.TextInput(
|
|
||||||
attrs={
|
|
||||||
"class": "form-control",
|
|
||||||
"placeholder": "Searching skill…",
|
|
||||||
"data-ref": "#id_educative",
|
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class UserForm(forms.ModelForm):
|
|
||||||
class Meta:
|
|
||||||
model = User
|
|
||||||
fields = (
|
|
||||||
"last_name",
|
|
||||||
"first_name",
|
|
||||||
"email",
|
|
||||||
"is_active",
|
|
||||||
"username",
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class GymnastForm(forms.ModelForm):
|
|
||||||
|
|
||||||
lastname = forms.CharField(
|
|
||||||
widget=forms.TextInput(
|
|
||||||
attrs={"class": "form-control", "placeholder": "Lastname"}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
firstname = forms.CharField(
|
|
||||||
widget=forms.TextInput(
|
|
||||||
attrs={"class": "form-control", "placeholder": "Firstname"}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
email = forms.EmailField()
|
|
||||||
# is_active = forms.CheckboxInput()
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
model = Gymnast
|
|
||||||
fields = (
|
|
||||||
"id",
|
|
||||||
"birthdate",
|
|
||||||
"gender",
|
|
||||||
"address",
|
|
||||||
"postal",
|
|
||||||
"city",
|
|
||||||
"phone",
|
|
||||||
"gsm",
|
|
||||||
"gsm_main_responsible",
|
|
||||||
"email_main_responsible",
|
|
||||||
"gsm_second_responsible",
|
|
||||||
"email_second_responsible",
|
|
||||||
"orientation",
|
|
||||||
"picture",
|
|
||||||
"content",
|
|
||||||
)
|
|
||||||
|
|
||||||
widgets = {
|
|
||||||
"id": forms.HiddenInput(),
|
|
||||||
"lastname": forms.TextInput(
|
|
||||||
attrs={"class": "form-control", "placeholder": "Lastname"}
|
|
||||||
),
|
|
||||||
"firstname": forms.TextInput(
|
|
||||||
attrs={"class": "form-control", "placeholder": "Firstname"}
|
|
||||||
),
|
|
||||||
"birthdate": forms.DateInput(attrs={"class": "form-control datepicker"}),
|
|
||||||
"gender": forms.Select(attrs={"class": "form-control"}),
|
|
||||||
"address": forms.TextInput(attrs={"class": "form-control"}),
|
|
||||||
"postal": forms.TextInput(attrs={"class": "form-control"}),
|
|
||||||
"city": forms.TextInput(attrs={"class": "form-control"}),
|
|
||||||
"phone": forms.TextInput(attrs={"class": "form-control"}),
|
|
||||||
"gsm": forms.TextInput(attrs={"class": "form-control"}),
|
|
||||||
"email": forms.EmailInput(attrs={"class": "form-control"}),
|
|
||||||
"gsm_main_responsible": forms.TextInput(attrs={"class": "form-control"}),
|
|
||||||
"email_main_responsible": forms.EmailInput(attrs={"class": "form-control"}),
|
|
||||||
"gsm_second_responsible": forms.TextInput(attrs={"class": "form-control"}),
|
|
||||||
"email_second_responsible": forms.EmailInput(
|
|
||||||
attrs={"class": "form-control"}
|
|
||||||
),
|
|
||||||
# "is_active": forms.CheckboxInput(
|
|
||||||
# attrs={
|
|
||||||
# "class": "bootstrap-switch mt-0",
|
|
||||||
# "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>",
|
|
||||||
# }
|
|
||||||
# ),
|
|
||||||
"orientation": forms.Select(attrs={"class": "form-control"}),
|
|
||||||
"picture": forms.Select(attrs={"class": "form-control"}),
|
|
||||||
"content": forms.Textarea(
|
|
||||||
attrs={
|
|
||||||
"class": "form-control",
|
|
||||||
"placeholder": "Informations about the gymnast.",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class GymnastHasRoutineForm(forms.ModelForm):
|
|
||||||
"""
|
|
||||||
"""
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
model = GymnastHasRoutine
|
|
||||||
fields = ("gymnast", "routine", "routine_type", "datebegin", "dateend")
|
|
||||||
widgets = {
|
|
||||||
"gymnast": forms.HiddenInput(),
|
|
||||||
"routine": forms.HiddenInput(),
|
|
||||||
"routine_type": forms.Select(attrs={"class": "form-control"}),
|
|
||||||
"datebegin": forms.DateInput(attrs={"class": "form-control datepicker",}),
|
|
||||||
"dateend": forms.DateInput(attrs={"class": "form-control datepicker",}),
|
|
||||||
}
|
|
||||||
|
|
||||||
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",
|
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
|
|
@ -1,24 +0,0 @@
|
||||||
# Generated by Django 3.2.2 on 2021-05-14 16:19
|
|
||||||
|
|
||||||
from django.db import migrations
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
("people", "0014_auto_20210513_1058"),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AlterModelOptions(
|
|
||||||
name="gymnast",
|
|
||||||
options={
|
|
||||||
"ordering": ["user__last_name", "user__first_name"],
|
|
||||||
"verbose_name": "Gymnast",
|
|
||||||
"verbose_name_plural": "Gymnasts",
|
|
||||||
},
|
|
||||||
),
|
|
||||||
migrations.RemoveField(model_name="gymnast", name="email",),
|
|
||||||
migrations.RemoveField(model_name="gymnast", name="firstname",),
|
|
||||||
migrations.RemoveField(model_name="gymnast", name="lastname",),
|
|
||||||
]
|
|
|
@ -1,38 +0,0 @@
|
||||||
# Generated by Django 3.2.2 on 2021-05-15 08:00
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
("people", "0015_auto_20210514_1619"),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.RemoveField(model_name="gymnast", name="active",),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="gymnast",
|
|
||||||
name="fedid",
|
|
||||||
field=models.CharField(
|
|
||||||
blank=True, max_length=10, null=True, verbose_name="Federation ID"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="gymnast",
|
|
||||||
name="orientation",
|
|
||||||
field=models.PositiveSmallIntegerField(
|
|
||||||
blank=True,
|
|
||||||
choices=[(None, "Unknown"), (0, "Left"), (1, "Right")],
|
|
||||||
null=True,
|
|
||||||
verbose_name="Twist side",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="gymnast",
|
|
||||||
name="phone",
|
|
||||||
field=models.CharField(
|
|
||||||
blank=True, max_length=9, null=True, verbose_name="Phond"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,19 +0,0 @@
|
||||||
# Generated by Django 3.2.2 on 2021-06-21 18:04
|
|
||||||
|
|
||||||
from django.db import migrations
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
("people", "0017_alter_gymnast_user"),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="gymnast", old_name="fedid", new_name="federation_id",
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="gymnast", old_name="have_routine", new_name="routine",
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,39 +0,0 @@
|
||||||
# Generated by Django 3.2.2 on 2021-06-21 18:09
|
|
||||||
|
|
||||||
from django.db import migrations
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
("people", "0018_auto_20210621_1804"),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="gymnast", old_name="cando", new_name="can_do",
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="gymnast",
|
|
||||||
old_name="email_father",
|
|
||||||
new_name="email_main_responsible",
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="gymnast",
|
|
||||||
old_name="email_mother",
|
|
||||||
new_name="email_second_responsible",
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="gymnast",
|
|
||||||
old_name="gsm_mother",
|
|
||||||
new_name="gsm_main_responsible",
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="gymnast",
|
|
||||||
old_name="gsm_father",
|
|
||||||
new_name="gsm_second_responsible",
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="gymnast", old_name="haveToDo", new_name="have_to_do",
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,329 +0,0 @@
|
||||||
"""Modélisation des gymnastes, accidents et relations à faire/faites.
|
|
||||||
|
|
||||||
Notes:
|
|
||||||
Est-ce qu'il ne faudrait pas refactoriser les GSM père/mère ?
|
|
||||||
Avec une table d'association, et un champ qui indique la qualité du contact ?
|
|
||||||
Du coup, cela permettrait se débarasser des champs phone, gsm, gsm_father et gsm_mother.
|
|
||||||
|
|
||||||
Comment sont gérées les évolutions ? Changement de clubs, de fédération,
|
|
||||||
|
|
||||||
A quoi correspond le champ `year_of_practice` ?
|
|
||||||
Comment se comportera-t-il dans un an ? Dans deux ans ?
|
|
||||||
Est-ce qu'il ne faudrait pas une date de début, plutôt ?
|
|
||||||
|
|
||||||
Idem pour la méthode `actual_year_of_pratice`.
|
|
||||||
Comme elle se base sur le champ `created_at`, il suffit que l'enregistrement ne soit pas
|
|
||||||
réalisé correctement pour que la méthode retourne une mauvaise information.
|
|
||||||
|
|
||||||
Que signifie qu'un gymnaste soit actif ou inactif ? Est-ce que cela ne devrait pas plutôt
|
|
||||||
être géré au niveau des utilisateurs ?
|
|
||||||
|
|
||||||
Au niveau des utilisateurs, comme un User Django a déjà les champs lastname/firstname
|
|
||||||
pourquoi ne pas les réutiliser ? On garde la clé OneToOne, mais on déplace dans l'autre
|
|
||||||
classe les champs qui peuvent l'être. `Email` s'y retrouve également.
|
|
||||||
|
|
||||||
Les relations `cando`, `haveToDo` et `have_routine` ne sont pas correctement nommées.
|
|
||||||
Si tu as une instance de `Gymnast`, tu devrais faire ceci :
|
|
||||||
|
|
||||||
>>> gregg = Gymnast.objects.first()
|
|
||||||
>>> gregg.have_routine <-- pas bien
|
|
||||||
>>> gregg.routines <-- ok
|
|
||||||
|
|
||||||
Idéalement, cela pourrait même être une indirection.
|
|
||||||
|
|
||||||
>>> gregg.routines <-- retourne la relation de type `have_routine`
|
|
||||||
>>> gregg.educatives.can_do <-- retourne les éducatifs qu'il **peut** faire
|
|
||||||
>>> gregg.educatives.must_do <-- retourne les éducatifs qu'il **doit** faire
|
|
||||||
(j'avoue ne pas tout à fait comprendre la nuance entre les deux)
|
|
||||||
|
|
||||||
<!> Tu as des fonctions qui ne sont pas du tout utilisées et qui pourrissent un peu le fichier.
|
|
||||||
>>> next_age() ? N'est appelé nulle part ailleurs.
|
|
||||||
>>> known_skills() <-- peut être récupéré directement via l'attribut `cando`
|
|
||||||
(du coup, tu as sans doute une piste de renommage ;-))
|
|
||||||
"""
|
|
||||||
|
|
||||||
from datetime import date
|
|
||||||
|
|
||||||
from django.contrib.auth import get_user_model
|
|
||||||
from django.db import models
|
|
||||||
|
|
||||||
import pendulum
|
|
||||||
|
|
||||||
from khana.base.models import Markdownizable
|
|
||||||
|
|
||||||
User = get_user_model()
|
|
||||||
|
|
||||||
|
|
||||||
class Gymnast(Markdownizable):
|
|
||||||
"""Représente un gymnaste.
|
|
||||||
|
|
||||||
En plus de sa signalétique (nom, prénom, date de naissance, ...),
|
|
||||||
un gymnaste aura une photo et une orientation (de vrille).
|
|
||||||
|
|
||||||
Un gymnaste peut être actif ou inactif.
|
|
||||||
"""
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
verbose_name = "Gymnast"
|
|
||||||
verbose_name_plural = "Gymnasts"
|
|
||||||
ordering = ["user__last_name", "user__first_name"]
|
|
||||||
|
|
||||||
GENDER_CHOICES = ((0, "Male"), (1, "Female"))
|
|
||||||
ORIENTATION_CHOICES = ((None, "Unknown"), (0, "Left"), (1, "Right"))
|
|
||||||
|
|
||||||
birthdate = models.DateField(verbose_name="Date de naissance")
|
|
||||||
gender = models.PositiveSmallIntegerField(
|
|
||||||
choices=GENDER_CHOICES, verbose_name="Sexe"
|
|
||||||
)
|
|
||||||
niss = models.CharField(max_length=11, null=True, blank=True)
|
|
||||||
address = models.CharField(max_length=255, null=True, blank=True)
|
|
||||||
postal = models.CharField(max_length=6, null=True, blank=True)
|
|
||||||
city = models.CharField(max_length=150, null=True, blank=True)
|
|
||||||
phone = models.CharField(max_length=9, null=True, blank=True, verbose_name="Phond")
|
|
||||||
gsm = models.CharField(max_length=10, null=True, blank=True)
|
|
||||||
federation_id = models.CharField(
|
|
||||||
max_length=10, null=True, blank=True, verbose_name="Federation ID"
|
|
||||||
)
|
|
||||||
gsm_main_responsible = models.CharField(
|
|
||||||
max_length=10, null=True, blank=True, verbose_name="GSM mère"
|
|
||||||
)
|
|
||||||
email_main_responsible = models.EmailField(max_length=255, null=True, blank=True)
|
|
||||||
gsm_second_responsible = models.CharField(
|
|
||||||
max_length=10, null=True, blank=True, verbose_name="GSM père"
|
|
||||||
)
|
|
||||||
email_second_responsible = models.EmailField(max_length=255, null=True, blank=True)
|
|
||||||
orientation = models.PositiveSmallIntegerField(
|
|
||||||
choices=ORIENTATION_CHOICES, null=True, blank=True, verbose_name="Twist side",
|
|
||||||
)
|
|
||||||
user = models.OneToOneField(User, on_delete=models.CASCADE, related_name="gymnast")
|
|
||||||
trainer = models.ForeignKey(
|
|
||||||
User, null=True, on_delete=models.SET_NULL, related_name="gymnasts"
|
|
||||||
)
|
|
||||||
club = models.ForeignKey(
|
|
||||||
"location.Club", null=True, on_delete=models.SET_NULL, related_name="gymnasts"
|
|
||||||
)
|
|
||||||
can_do = models.ManyToManyField(
|
|
||||||
"objective.Educative",
|
|
||||||
through="CanDoRelation",
|
|
||||||
related_name="isdoneby", # related_name to change
|
|
||||||
)
|
|
||||||
have_to_do = models.ManyToManyField(
|
|
||||||
"objective.Educative",
|
|
||||||
through="ToDoRelation",
|
|
||||||
related_name="mustBeDoneBy", # related_name to change
|
|
||||||
)
|
|
||||||
routine = models.ManyToManyField(
|
|
||||||
"objective.Routine",
|
|
||||||
through="GymnastHasRoutine",
|
|
||||||
related_name="doneBy", # related_name to change
|
|
||||||
)
|
|
||||||
picture = models.ImageField(upload_to="gymnasts", null=True, blank=True)
|
|
||||||
year_of_practice = models.PositiveSmallIntegerField(default=0)
|
|
||||||
created_at = models.DateTimeField(auto_now_add=True)
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return u"%s, %s" % (self.user.last_name, self.user.first_name)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def next_birthday(self):
|
|
||||||
"""Définit la prochaine date (de fête) d'anniversaire pour cette personne.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Soit le jour/mois pour cette année
|
|
||||||
Soit le jour/mois pour l'année prochaine.
|
|
||||||
|
|
||||||
Examples: en supposant qu'on soit le 23/05/2019
|
|
||||||
>>> from datetime import date
|
|
||||||
>>> gregg = People(name='Tru', firstname='Gregg', birthdate=date(1982, 2, 5)
|
|
||||||
>>> gregg.next_birthday()
|
|
||||||
Date(2020, 2, 5)
|
|
||||||
"""
|
|
||||||
|
|
||||||
now = pendulum.now()
|
|
||||||
|
|
||||||
this_year_birthday = pendulum.date(
|
|
||||||
now.year, self.birthdate.month, self.birthdate.day
|
|
||||||
)
|
|
||||||
|
|
||||||
if this_year_birthday.is_past():
|
|
||||||
return pendulum.date(now.year + 1, self.birthdate.month, self.birthdate.day)
|
|
||||||
return this_year_birthday
|
|
||||||
|
|
||||||
@property
|
|
||||||
def next_birthday_in_days(self):
|
|
||||||
now = pendulum.now()
|
|
||||||
return self.next_birthday.diff(now).in_days()
|
|
||||||
|
|
||||||
@property
|
|
||||||
def age(self):
|
|
||||||
""" Renvoie l'âge d'un gymnaste. """
|
|
||||||
today = date.today()
|
|
||||||
return (
|
|
||||||
today.year
|
|
||||||
- self.birthdate.year
|
|
||||||
- ((today.month, today.day) < (self.birthdate.month, self.birthdate.day))
|
|
||||||
)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def next_age(self):
|
|
||||||
""" Renvoie l'âge prochain du gymnaste. """
|
|
||||||
return (self.age) + 1
|
|
||||||
|
|
||||||
@property
|
|
||||||
def known_skills(self):
|
|
||||||
""" Renvoie la liste des objectifs qu'un gymnaste sait faire. """
|
|
||||||
return CanDoRelation.objects.filter(gymnast=self.id)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def actual_year_of_pratice(self):
|
|
||||||
"""
|
|
||||||
Renvoie le nombre d'année de pratique du gymnaste en se basant sur le
|
|
||||||
nombre d'année qu'il avait déjà lors de son introduction dans le
|
|
||||||
système + le nombre d'année qu'il est dans le système.
|
|
||||||
"""
|
|
||||||
period = pendulum.now() - pendulum.instance(self.created_at, "Europe/Brussels")
|
|
||||||
return int(self.year_of_practice + period.in_years())
|
|
||||||
|
|
||||||
|
|
||||||
class Accident(Markdownizable):
|
|
||||||
"""La classe `Accident` permet d'indiquer qu'un gymnaste est tombé durant un saut.
|
|
||||||
"""
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
verbose_name = "Accident"
|
|
||||||
verbose_name_plural = "Accidents"
|
|
||||||
# ordering = ["date", "gymnast"]
|
|
||||||
|
|
||||||
gymnast = models.ForeignKey(
|
|
||||||
Gymnast,
|
|
||||||
verbose_name="Gymnast",
|
|
||||||
related_name="accident",
|
|
||||||
on_delete=models.CASCADE,
|
|
||||||
)
|
|
||||||
educative = models.ForeignKey(
|
|
||||||
"objective.Skill",
|
|
||||||
verbose_name="Skill",
|
|
||||||
related_name="accident",
|
|
||||||
on_delete=models.CASCADE,
|
|
||||||
)
|
|
||||||
date = models.DateField(verbose_name="Date")
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return "%s(%s)" % (
|
|
||||||
self.gymnast,
|
|
||||||
self.date,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class CanDoRelation(models.Model):
|
|
||||||
"""
|
|
||||||
Représente les objectifs qu'un gymnaste sait faire (à partir d'une date donnée).
|
|
||||||
"""
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
verbose_name = "CanDo"
|
|
||||||
verbose_name_plural = "CanDos"
|
|
||||||
ordering = ["date", "educative", "gymnast"]
|
|
||||||
unique_together = ("gymnast", "educative")
|
|
||||||
|
|
||||||
gymnast = models.ForeignKey(
|
|
||||||
Gymnast,
|
|
||||||
verbose_name="Gymnast",
|
|
||||||
related_name="toObjective",
|
|
||||||
on_delete=models.CASCADE,
|
|
||||||
)
|
|
||||||
educative = models.ForeignKey(
|
|
||||||
"objective.Educative",
|
|
||||||
verbose_name="Skill",
|
|
||||||
related_name="cando",
|
|
||||||
on_delete=models.CASCADE,
|
|
||||||
)
|
|
||||||
date = models.DateField(default=date.today, verbose_name="Date")
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return "%s - %s" % (
|
|
||||||
self.gymnast,
|
|
||||||
self.educative.shortLabel,
|
|
||||||
)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def create(gymnast, skill, linkdate):
|
|
||||||
c = CanDoRelation()
|
|
||||||
c.gymnast = gymnast
|
|
||||||
c.educative = skill
|
|
||||||
c.date = linkdate
|
|
||||||
c.save()
|
|
||||||
return c
|
|
||||||
|
|
||||||
|
|
||||||
class ToDoRelation(models.Model):
|
|
||||||
"""
|
|
||||||
Classe représentant les objectifs qu'une gymnaste devra savoir faire pour une date donnée.
|
|
||||||
"""
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
verbose_name = "ToDo"
|
|
||||||
verbose_name_plural = "ToDos"
|
|
||||||
ordering = ["date", "educative", "gymnast"]
|
|
||||||
unique_together = ("gymnast", "educative")
|
|
||||||
|
|
||||||
gymnast = models.ForeignKey(
|
|
||||||
Gymnast, verbose_name="Gymnast", related_name="todo", on_delete=models.CASCADE
|
|
||||||
)
|
|
||||||
educative = models.ForeignKey(
|
|
||||||
"objective.Educative",
|
|
||||||
verbose_name="Skill",
|
|
||||||
related_name="isInToDo",
|
|
||||||
on_delete=models.CASCADE,
|
|
||||||
)
|
|
||||||
date = models.DateField(default=date.today, verbose_name="Date")
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return "%s - %s" % (
|
|
||||||
self.gymnast,
|
|
||||||
self.educative.short_label,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class GymnastHasRoutine(models.Model):
|
|
||||||
"""
|
|
||||||
Classe représentant le lien entre les gymnastes et leurs séries.
|
|
||||||
"""
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
verbose_name = "Gymnast Has Routine"
|
|
||||||
verbose_name_plural = "Gymnast Has Routines"
|
|
||||||
|
|
||||||
ROUTINETYPE_CHOICE = (
|
|
||||||
(1, "L1"),
|
|
||||||
(2, "L2"),
|
|
||||||
(3, "L3"),
|
|
||||||
(4, "L4"),
|
|
||||||
(5, "L1S"),
|
|
||||||
(6, "L2S"),
|
|
||||||
(7, "L3S"),
|
|
||||||
(8, "L4S"),
|
|
||||||
)
|
|
||||||
|
|
||||||
gymnast = models.ForeignKey(
|
|
||||||
Gymnast,
|
|
||||||
verbose_name="Gymnast",
|
|
||||||
related_name="has_routine",
|
|
||||||
on_delete=models.CASCADE,
|
|
||||||
)
|
|
||||||
routine = models.ForeignKey(
|
|
||||||
"objective.Routine",
|
|
||||||
verbose_name="Routine",
|
|
||||||
related_name="used_by_gymnast",
|
|
||||||
on_delete=models.CASCADE,
|
|
||||||
)
|
|
||||||
routine_type = models.PositiveSmallIntegerField(
|
|
||||||
choices=ROUTINETYPE_CHOICE, verbose_name="Type", default="1"
|
|
||||||
)
|
|
||||||
datebegin = models.DateField(default=date.today, verbose_name="Date begin")
|
|
||||||
dateend = models.DateField(
|
|
||||||
default=date.today, verbose_name="Date end", null=True, blank=True
|
|
||||||
)
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return "%s - %s : %s" % (self.gymnast, self.routine_type, self.routine)
|
|
|
@ -1,5 +0,0 @@
|
||||||
from django.apps import AppConfig
|
|
||||||
|
|
||||||
|
|
||||||
class PlanningConfig(AppConfig):
|
|
||||||
name = "khana.planning"
|
|
|
@ -1,33 +0,0 @@
|
||||||
# Generated by Django 3.2.2 on 2021-05-13 10:58
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
("planning", "0020_event_gymnasts"),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="course", old_name="information", new_name="content",
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="event", old_name="information", new_name="content",
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="planningline", old_name="information", new_name="content",
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="round", old_name="information", new_name="content",
|
|
||||||
),
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name="unavailability", old_name="information", new_name="content",
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="group",
|
|
||||||
name="season",
|
|
||||||
field=models.CharField(default="2021-2022", max_length=9),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,17 +0,0 @@
|
||||||
# Generated by Django 3.2.8 on 2021-12-05 11:33
|
|
||||||
|
|
||||||
from django.db import migrations
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('planning', '0021_auto_20210513_1058'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AlterModelOptions(
|
|
||||||
name='event_participation',
|
|
||||||
options={'verbose_name': 'Event Participation'},
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,18 +0,0 @@
|
||||||
# Generated by Django 4.0.1 on 2022-01-13 21:01
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('planning', '0022_alter_event_participation_options'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='group',
|
|
||||||
name='season',
|
|
||||||
field=models.CharField(default='2022-2023', max_length=9),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,513 +0,0 @@
|
||||||
from datetime import datetime, date, time, timedelta
|
|
||||||
|
|
||||||
from django.contrib.auth import get_user_model
|
|
||||||
from django.db import models
|
|
||||||
from django.utils import timezone
|
|
||||||
|
|
||||||
import pendulum
|
|
||||||
|
|
||||||
from khana.base.models import Markdownizable
|
|
||||||
from khana.location.models import Club
|
|
||||||
from khana.people.models import Gymnast
|
|
||||||
|
|
||||||
|
|
||||||
User = get_user_model()
|
|
||||||
|
|
||||||
|
|
||||||
def get_week(a_date):
|
|
||||||
"""
|
|
||||||
|
|
||||||
Remarks:
|
|
||||||
Je ne comprends pas trop cette fonction...
|
|
||||||
Tu pars d'une date, et tu récupères le lundi et le samedi de la semaine correspondant ?
|
|
||||||
"""
|
|
||||||
the_date = pendulum.parse(a_date)
|
|
||||||
day = the_date.weekday()
|
|
||||||
monday = the_date - timedelta(days=day)
|
|
||||||
sunday = the_date + timedelta(days=(6 - day))
|
|
||||||
return monday, sunday
|
|
||||||
|
|
||||||
|
|
||||||
def get_number_of_weeks_between(start, stop):
|
|
||||||
"""
|
|
||||||
Renvoie le nombre de semaines entre deux dates.
|
|
||||||
Par extension, cela permet de connaitre le nombre d'occurence d'un
|
|
||||||
évènement (entraînement, par exemple) hebdromadaire entre deux dates
|
|
||||||
et ainsi pouvoir plannifier.
|
|
||||||
|
|
||||||
:param start: date de début de la période
|
|
||||||
:type start: datetime.date
|
|
||||||
:param stop: date de fin de la période
|
|
||||||
:type stop: datetime.date
|
|
||||||
:return: Le nombre de semaines entre les deux dates.
|
|
||||||
|
|
||||||
Remarks:
|
|
||||||
Proposition d'utiliser isocalendar() sur une date.
|
|
||||||
L'indice 1 de la valeur de retour donne la semaine correspondant.
|
|
||||||
|
|
||||||
Eg.
|
|
||||||
>>> from datetime import date
|
|
||||||
>>> d = date(2020, 9, 27)
|
|
||||||
>>> d.isocalendar()
|
|
||||||
(2020, 39, 7)
|
|
||||||
|
|
||||||
-> Est-ce qu'il ne suffirait pas de faire la différence ?
|
|
||||||
"""
|
|
||||||
|
|
||||||
tmp = stop - start
|
|
||||||
number_of_days = abs(tmp.days)
|
|
||||||
number_of_week = int((number_of_days + 1) / 7)
|
|
||||||
|
|
||||||
if ((number_of_days + 1) % 7) > 0:
|
|
||||||
number_of_week += 1
|
|
||||||
|
|
||||||
if tmp.days < 0:
|
|
||||||
number_of_week *= -1
|
|
||||||
|
|
||||||
return number_of_week
|
|
||||||
|
|
||||||
|
|
||||||
class TemporizableQuerySet(models.QuerySet):
|
|
||||||
"""
|
|
||||||
Classe permettant de spécifier le `QuerySet` de la classe `Temporizable`.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def next(self, limit):
|
|
||||||
"""
|
|
||||||
Renvoie la liste des prochains "temporizable" (par rapport à la date du jour).
|
|
||||||
|
|
||||||
:param limit: nombre d'éléments désirés.
|
|
||||||
:type limit: int
|
|
||||||
:return: une liste de `limit` éléments temporizables.
|
|
||||||
"""
|
|
||||||
return self.filter(datebegin__gte=timezone.now()).order_by("datebegin")[0:limit]
|
|
||||||
|
|
||||||
def last(self, limit):
|
|
||||||
"""
|
|
||||||
Renvoie la liste des derniers "temporizable" (par rapport à la date du jour).
|
|
||||||
|
|
||||||
:param limit: nombre d'éléments désirés.
|
|
||||||
:type limit: int
|
|
||||||
:return: une liste de `limit` éléments temporizables
|
|
||||||
"""
|
|
||||||
return self.filter(dateend__lte=timezone.now()).order_by("-dateend")[0:limit]
|
|
||||||
|
|
||||||
# def get(self, date_string):
|
|
||||||
# """
|
|
||||||
# """
|
|
||||||
# try:
|
|
||||||
# selected_object = self.get(datebegin__lte=date_string, dateend__gte=date_string)
|
|
||||||
# except self.DoesNotExist:
|
|
||||||
# return None
|
|
||||||
# except self.MultipleObjectsReturned:
|
|
||||||
# return None
|
|
||||||
|
|
||||||
# return selected_object
|
|
||||||
|
|
||||||
|
|
||||||
class Temporizable(models.Model):
|
|
||||||
"""Classe abstraite définissant une période comprise entre deux dates.
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
abstract = True
|
|
||||||
|
|
||||||
datebegin = models.DateTimeField(verbose_name="Début")
|
|
||||||
dateend = models.DateTimeField(blank=True, verbose_name="Fin")
|
|
||||||
|
|
||||||
objects = models.Manager.from_queryset(TemporizableQuerySet)()
|
|
||||||
|
|
||||||
def get_total_occurence(self):
|
|
||||||
"""
|
|
||||||
Renvoie le nombre de semaines entre les deux dates d'une instance de la
|
|
||||||
classe `Temporizable`.
|
|
||||||
|
|
||||||
:return: nombre de semaines.
|
|
||||||
"""
|
|
||||||
return get_number_of_weeks_between(self.datebegin.date(), self.dateend.date())
|
|
||||||
|
|
||||||
def get_number_of_occurence_to_event(self, the_date):
|
|
||||||
"""
|
|
||||||
Renvoie le nombre semaines entre une date choisie et le début
|
|
||||||
(datebegin) d'une instance de la classe `Temporizable`.
|
|
||||||
|
|
||||||
:param the_date: date par rapport à laquelle le calcul sera fait.
|
|
||||||
:type the_date: datetime.date
|
|
||||||
:return: nombre de semaines.
|
|
||||||
"""
|
|
||||||
return get_number_of_weeks_between(the_date, self.datebegin.date())
|
|
||||||
|
|
||||||
def get_number_of_occurence_inbetween(self, the_date, rest=True):
|
|
||||||
"""
|
|
||||||
Renvoie le nombre semaines entre une date choisie et une instance de la
|
|
||||||
classe `Temporizable`. Le calcul peut se faire soit entre la date
|
|
||||||
choisie et le date de fin d'une occurence de la classe, soit entre la
|
|
||||||
date de début d'une occurence de la classe et la date choisie.
|
|
||||||
|
|
||||||
:param the_date: date par rapport à laquelle le calcul sera fait.
|
|
||||||
:type the_date: datetime.date
|
|
||||||
:param rest: paramètre définissant s'il faut calculer le reste des
|
|
||||||
occurences à venir (depuis `the_date` jusqu'à la date de fin) ou
|
|
||||||
les occurences déjà passées (depuis la date de début jusqu'à
|
|
||||||
`the_date`)
|
|
||||||
:type rest: booléen
|
|
||||||
:return: nombre de semaines.
|
|
||||||
"""
|
|
||||||
if rest:
|
|
||||||
return get_number_of_weeks_between(the_date, self.dateend.date())
|
|
||||||
else:
|
|
||||||
return get_number_of_weeks_between(self.datebegin.date(), the_date)
|
|
||||||
|
|
||||||
|
|
||||||
class Season(Temporizable):
|
|
||||||
"""
|
|
||||||
Classe représentant une saison. Une saison est déinie par :
|
|
||||||
- un id,
|
|
||||||
- un label,
|
|
||||||
- une date de début et
|
|
||||||
- une date de fin.
|
|
||||||
|
|
||||||
La date de début est très souvent le : 01/09/xxxx
|
|
||||||
La date de fin est très souvent le : 31/08/xxxy
|
|
||||||
exemple : 1/9/2015 - 31/8/2016
|
|
||||||
"""
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
verbose_name = "Season"
|
|
||||||
verbose_name_plural = "Seasons"
|
|
||||||
|
|
||||||
label = models.CharField(max_length=11, verbose_name="Label")
|
|
||||||
# active ou default = models.BooleanField(verbose_name='Défaut')
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return "%s" % (self.label)
|
|
||||||
|
|
||||||
def week_number_from_begin(self, target_date):
|
|
||||||
return get_number_of_weeks_between(self.datebegin.date(), target_date)
|
|
||||||
|
|
||||||
|
|
||||||
class EventType(models.Model):
|
|
||||||
"""
|
|
||||||
Classe représentant les types d'évènements.
|
|
||||||
C'est un dictionnaire fini :
|
|
||||||
- compétiton qualificative,
|
|
||||||
- compétition finale,
|
|
||||||
- démonstration,
|
|
||||||
- …
|
|
||||||
"""
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
verbose_name = "Event Type"
|
|
||||||
verbose_name_plural = "Event Types"
|
|
||||||
|
|
||||||
name = models.CharField(max_length=255, verbose_name="Nom")
|
|
||||||
acronym = models.CharField(max_length=5, verbose_name="Acronyme")
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return "%s (%s)" % (self.name, self.acronym)
|
|
||||||
|
|
||||||
|
|
||||||
class Event(Markdownizable, Temporizable):
|
|
||||||
"""Classe représentant les évènements.
|
|
||||||
|
|
||||||
Un évènement est caractérisé par :
|
|
||||||
* un nom,
|
|
||||||
* un lieu (place),
|
|
||||||
* un type (compétition, démonstration, …),
|
|
||||||
* des gymnastes (participation prévue).
|
|
||||||
Je ne me rapelle plus à quoi sert le club.
|
|
||||||
"""
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
verbose_name = "Event"
|
|
||||||
verbose_name_plural = "Event"
|
|
||||||
|
|
||||||
place = models.ForeignKey(
|
|
||||||
"location.Place", verbose_name="Lieu", on_delete=models.CASCADE, default=None
|
|
||||||
)
|
|
||||||
eventtype = models.ForeignKey(
|
|
||||||
EventType, verbose_name="Type", on_delete=models.CASCADE, default=None
|
|
||||||
)
|
|
||||||
name = models.CharField(max_length=255, verbose_name="Nom")
|
|
||||||
# club = models.ManyToManyField('location.Club', related_name="concernate_by", blank=True)
|
|
||||||
gymnasts = models.ManyToManyField(
|
|
||||||
"people.Gymnast",
|
|
||||||
through="Event_Participation",
|
|
||||||
related_name="participate_to",
|
|
||||||
verbose_name="Participants",
|
|
||||||
)
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return "%s (à %s)" % (self.name, self.place.city)
|
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
|
||||||
self.checkdates()
|
|
||||||
super().save(*args, **kwargs)
|
|
||||||
|
|
||||||
def checkdates(self):
|
|
||||||
"""
|
|
||||||
Fonction assignant la date de fin d'un évènement à la date de début, si la date
|
|
||||||
de fin n'est pas définie, l'heure de fin est par défaut 18h00.
|
|
||||||
"""
|
|
||||||
if self.dateend is None and self.datebegin is not None:
|
|
||||||
self.dateend = datetime.combine(self.datebegin.date(), time(18, 0))
|
|
||||||
|
|
||||||
@property
|
|
||||||
def number_of_week_from_today(self):
|
|
||||||
today = pendulum.now().date()
|
|
||||||
return get_number_of_weeks_between(today, self.datebegin.date())
|
|
||||||
|
|
||||||
|
|
||||||
class Event_Participation(models.Model):
|
|
||||||
"""
|
|
||||||
"""
|
|
||||||
|
|
||||||
event = models.ForeignKey(Event, on_delete=models.CASCADE)
|
|
||||||
gymnast = models.ForeignKey("people.Gymnast", on_delete=models.CASCADE)
|
|
||||||
rank = models.PositiveSmallIntegerField(default=0)
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
verbose_name = "Event Participation"
|
|
||||||
|
|
||||||
|
|
||||||
class Course(Markdownizable, Temporizable):
|
|
||||||
"""Classe représentant les cours.
|
|
||||||
|
|
||||||
Un cours est défini par :
|
|
||||||
* une heure de début et une heure de fin,
|
|
||||||
* une date de début et une date de fin (un cours est considéré comme donné hebdromadairement entre
|
|
||||||
ces deux dates) (hérite de la classe `Temporizable`)
|
|
||||||
* est associé à un ou plusieurs entraineurs,
|
|
||||||
* est associé à un club
|
|
||||||
* est associé à un jour de la semaine (numéro du jour dans la semaine : 0 = lundi, 6 = dimanche).
|
|
||||||
"""
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
verbose_name = "Course"
|
|
||||||
verbose_name_plural = "Courses"
|
|
||||||
|
|
||||||
DAY_CHOICE = (
|
|
||||||
(1, "Lundi"),
|
|
||||||
(2, "Mardi"),
|
|
||||||
(3, "Mercredi"),
|
|
||||||
(4, "Jeudi"),
|
|
||||||
(5, "Vendredi"),
|
|
||||||
(6, "Samedi"),
|
|
||||||
(7, "Dimanche"),
|
|
||||||
)
|
|
||||||
|
|
||||||
club = models.ForeignKey(
|
|
||||||
"location.Club", verbose_name="Club", on_delete=models.CASCADE, default=None
|
|
||||||
)
|
|
||||||
iso_day_number = models.PositiveSmallIntegerField(
|
|
||||||
choices=DAY_CHOICE, verbose_name="Jour"
|
|
||||||
)
|
|
||||||
hour_begin = models.TimeField(verbose_name="Heure de début")
|
|
||||||
hour_end = models.TimeField(verbose_name="Heure de fin")
|
|
||||||
season = models.ForeignKey(Season, on_delete=models.SET_NULL, null=True)
|
|
||||||
trainers = models.ManyToManyField(
|
|
||||||
User, verbose_name="Coach(es)", related_name="trainee"
|
|
||||||
)
|
|
||||||
gymnasts = models.ManyToManyField(
|
|
||||||
Gymnast, verbose_name="Gymnasts", related_name="courses"
|
|
||||||
)
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return "%s (%s à %s)" % (
|
|
||||||
self.get_iso_day_number_display(),
|
|
||||||
self.hour_begin.strftime("%H:%M"),
|
|
||||||
self.hour_end.strftime("%H:%M"),
|
|
||||||
)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def duration(self):
|
|
||||||
"""
|
|
||||||
Renvoie la durée d'un cours en heures
|
|
||||||
"""
|
|
||||||
date_begin = pendulum.datetime(
|
|
||||||
2000, 1, 1, self.hour_begin.hour, self.hour_begin.minute
|
|
||||||
)
|
|
||||||
date_end = pendulum.datetime(
|
|
||||||
2000, 1, 1, self.hour_end.hour, self.hour_end.minute
|
|
||||||
)
|
|
||||||
return date_end.diff(date_begin).in_hours()
|
|
||||||
|
|
||||||
|
|
||||||
class Group(models.Model):
|
|
||||||
"""Classe représentant les groupes (Loisir, D1, D2, A, B, …).
|
|
||||||
|
|
||||||
Un groupe appartient à un club.
|
|
||||||
"""
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
verbose_name = "Group"
|
|
||||||
verbose_name_plural = "Groups"
|
|
||||||
|
|
||||||
club = models.ForeignKey("location.Club", on_delete=models.CASCADE, default=None)
|
|
||||||
name = models.CharField(max_length=255)
|
|
||||||
acronym = models.CharField(max_length=50)
|
|
||||||
active = models.BooleanField(default=1)
|
|
||||||
season = models.CharField(
|
|
||||||
max_length=9,
|
|
||||||
default=str(timezone.now().year) + "-" + str(timezone.now().year + 1),
|
|
||||||
)
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return "%s (%s)" % (self.name, self.acronym)
|
|
||||||
|
|
||||||
|
|
||||||
class Subgroup(models.Model):
|
|
||||||
"""Classe représentant les sous-groupes.
|
|
||||||
|
|
||||||
Un sous-groupe appartient à un groupe (lui-même lié à un club).
|
|
||||||
|
|
||||||
De cette manière, quand un gymnaste est mis dans un sous-groupe, en remontant via le groupe,
|
|
||||||
nous pouvons connaître le(s) club(s) du gymnaste pour chaque saison.
|
|
||||||
"""
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
verbose_name = "Subgroup"
|
|
||||||
verbose_name_plural = "Subgroups"
|
|
||||||
|
|
||||||
name = models.CharField(max_length=255)
|
|
||||||
acronym = models.CharField(max_length=50)
|
|
||||||
group = models.ForeignKey(Group, on_delete=models.CASCADE, default=None)
|
|
||||||
courses = models.ManyToManyField(Course, related_name="to_subgroup")
|
|
||||||
gymnasts = models.ManyToManyField(
|
|
||||||
"people.Gymnast", related_name="to_gym", blank=True
|
|
||||||
)
|
|
||||||
active = models.BooleanField(default=1)
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return "%s (%s)" % (self.name, self.group.name)
|
|
||||||
|
|
||||||
|
|
||||||
class UnavailabilityManager(models.Manager):
|
|
||||||
"""Classe représentant le manager de la classe `Unavailability`.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def next(self, count):
|
|
||||||
return self.filter(datebegin__gte=timezone.now()).order_by("datebegin")[0:count]
|
|
||||||
|
|
||||||
def last(self, count):
|
|
||||||
return self.filter(dateend__lte=timezone.now()).order_by("-dateend")[0:count]
|
|
||||||
|
|
||||||
|
|
||||||
class Unavailability(Markdownizable, Temporizable):
|
|
||||||
"""Classe représentant les indisponibilités.
|
|
||||||
"""
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
verbose_name = "Indisponibilité"
|
|
||||||
verbose_name_plural = "Indisponibilités"
|
|
||||||
|
|
||||||
course = models.ManyToManyField(Course, related_name="unavailability")
|
|
||||||
|
|
||||||
objects = UnavailabilityManager()
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return "du %s au %s" % (self.datebegin, self.dateend)
|
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
|
||||||
self.checkdates()
|
|
||||||
|
|
||||||
super().save(*args, **kwargs)
|
|
||||||
|
|
||||||
def checkdates(self):
|
|
||||||
if self.dateend is None and self.datebegin is not None:
|
|
||||||
self.dateend = self.datebegin
|
|
||||||
|
|
||||||
|
|
||||||
class Training(models.Model):
|
|
||||||
"""Classe représentant les entraînements.
|
|
||||||
|
|
||||||
Un entraînement est une occurence d'un cours pendant lequel des gmnastes sont présents.
|
|
||||||
|
|
||||||
Un objet de cette classe lie donc un cours et un gymnaste à une date donnée.
|
|
||||||
"""
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
verbose_name = "Training"
|
|
||||||
verbose_name_plural = "Trainings"
|
|
||||||
|
|
||||||
gymnast = models.ForeignKey(
|
|
||||||
"people.Gymnast",
|
|
||||||
verbose_name="Gymnast",
|
|
||||||
on_delete=models.CASCADE,
|
|
||||||
default=None,
|
|
||||||
related_name="trainings",
|
|
||||||
)
|
|
||||||
course = models.ForeignKey(
|
|
||||||
Course, verbose_name="Course", on_delete=models.CASCADE, default=None
|
|
||||||
)
|
|
||||||
trainingdate = models.DateField(verbose_name="Date")
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return "%s - %s, %s" % (self.trainingdate, self.course, self.gymnast)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def create(gymnast, course, trainingdate):
|
|
||||||
t = Training()
|
|
||||||
t.gymnast = gymnast
|
|
||||||
t.course = course
|
|
||||||
t.trainingdate = trainingdate
|
|
||||||
t.save()
|
|
||||||
return t
|
|
||||||
|
|
||||||
|
|
||||||
class Round(Markdownizable):
|
|
||||||
"""Classe représentant les passages des élèves lors d'un entrainement.
|
|
||||||
|
|
||||||
Chaque record représente un passage. Il est donc lié à un record de la classe `Training`.
|
|
||||||
"""
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
verbose_name = "Round"
|
|
||||||
verbose_name_plural = "Rounds"
|
|
||||||
|
|
||||||
EVALUATION_CHOICES = (
|
|
||||||
(0, "- -"),
|
|
||||||
(1, "- +"),
|
|
||||||
(2, "+ -"),
|
|
||||||
(3, "+ +"),
|
|
||||||
)
|
|
||||||
|
|
||||||
training = models.ForeignKey(
|
|
||||||
Training, on_delete=models.CASCADE, default=None, related_name="rounds"
|
|
||||||
)
|
|
||||||
educative = models.ForeignKey(
|
|
||||||
"objective.Educative",
|
|
||||||
on_delete=models.CASCADE,
|
|
||||||
default=None,
|
|
||||||
blank=True,
|
|
||||||
null=True,
|
|
||||||
)
|
|
||||||
round_information = models.CharField(max_length=255, blank=True, null=True)
|
|
||||||
round_number = models.PositiveSmallIntegerField(blank=True, null=True)
|
|
||||||
gymnast_evaluation = models.PositiveSmallIntegerField(
|
|
||||||
choices=EVALUATION_CHOICES, blank=True, null=True
|
|
||||||
)
|
|
||||||
coach_evaluation = models.PositiveSmallIntegerField(blank=True, null=True)
|
|
||||||
coachid = models.ForeignKey(User, blank=True, null=True, on_delete=models.SET_NULL)
|
|
||||||
nb_of_realisation = models.PositiveSmallIntegerField(blank=True, null=True)
|
|
||||||
nb_of_success = models.PositiveSmallIntegerField(blank=True, null=True)
|
|
||||||
is_important = models.BooleanField(default=False)
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return "%s" % (self.round_number)
|
|
||||||
|
|
||||||
|
|
||||||
class PlanningLine(Markdownizable):
|
|
||||||
"""Classe représentant les passages prévisionnels (incubating idea).
|
|
||||||
"""
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
verbose_name = "Planning Line"
|
|
||||||
verbose_name_plural = "Planning lines"
|
|
||||||
# ordering = ['gymnast', 'date', 'order']
|
|
||||||
|
|
||||||
gymnast = models.ForeignKey(Gymnast, on_delete=models.CASCADE, default=None)
|
|
||||||
date = models.DateField(verbose_name="Date")
|
|
||||||
order = models.PositiveSmallIntegerField()
|
|
||||||
todo = models.CharField(max_length=255)
|
|
|
@ -1,4 +0,0 @@
|
||||||
[pytest]
|
|
||||||
DJANGO_SETTINGS_MODULE = config.settings
|
|
||||||
|
|
||||||
python_files = tests.py test_*.py *_tests.py
|
|
|
@ -1 +0,0 @@
|
||||||
-r requirements/base.txt
|
|
|
@ -9,8 +9,3 @@ Markdown==3.3.4
|
||||||
reportlab==3.5.67
|
reportlab==3.5.67
|
||||||
simplejson==3.17.2
|
simplejson==3.17.2
|
||||||
Sphinx==3.5.4
|
Sphinx==3.5.4
|
||||||
|
|
||||||
whitenoise==5.3
|
|
||||||
|
|
||||||
gunicorn
|
|
||||||
psycopg2
|
|
||||||
|
|
|
@ -1,13 +1,9 @@
|
||||||
-r base.txt
|
-r base.txt
|
||||||
|
|
||||||
sqlparse==0.4.1
|
|
||||||
mysqlclient==2.0.3
|
|
||||||
black==19.10b0
|
black==19.10b0
|
||||||
coverage==5.5
|
coverage==5.5
|
||||||
flake8==3.9.1
|
flake8==3.9.1
|
||||||
pylint==2.8.2
|
|
||||||
pylint-django==2.4.4
|
|
||||||
django-spaghetti-and-meatballs==0.4.2
|
django-spaghetti-and-meatballs==0.4.2
|
||||||
docutils==0.16
|
docutils==0.16
|
||||||
pytest==6.2.4
|
pytest==6.2.4
|
||||||
pytest-django==4.2.0
|
pytest-django==4.2.0
|
|
@ -0,0 +1,4 @@
|
||||||
|
-r dev.txt
|
||||||
|
|
||||||
|
mysqlclient==2.0.3
|
||||||
|
sqlparse==0.4.1
|
|
@ -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."
|
|
@ -20,5 +20,5 @@ class Markdownizable(models.Model):
|
||||||
|
|
||||||
def to_markdown(self):
|
def to_markdown(self):
|
||||||
"""Convertit le champ `content` en (Github-flavored) Markdown."""
|
"""Convertit le champ `content` en (Github-flavored) Markdown."""
|
||||||
|
|
||||||
return markdown.markdown(self.content)
|
return markdown.markdown(self.content)
|
|
@ -11,6 +11,6 @@ class TestMarkdownizable(TestCase):
|
||||||
|
|
||||||
def test_to_markdown(self):
|
def test_to_markdown(self):
|
||||||
"""Vérifie qu'un contenu Markdown est correctement convertit en HTML."""
|
"""Vérifie qu'un contenu Markdown est correctement convertit en HTML."""
|
||||||
markdown_content = Markdownizable(information="# Title")
|
m = Markdownizable(information="# Title")
|
||||||
|
|
||||||
self.assertEqual(markdown_content.to_markdown(), "<h1>Title</h1>")
|
self.assertEqual(m.to_markdown(), "<h1>Title</h1>")
|
|
@ -7,9 +7,6 @@ from .models import Message
|
||||||
|
|
||||||
@admin.register(Message)
|
@admin.register(Message)
|
||||||
class MessageAdmin(admin.ModelAdmin):
|
class MessageAdmin(admin.ModelAdmin):
|
||||||
"""La classe `MessageAdmin` contrôle la gestion des messages
|
|
||||||
"""
|
|
||||||
|
|
||||||
list_display = ("sender", "recipient", "written_at", "is_read", "read_at")
|
list_display = ("sender", "recipient", "written_at", "is_read", "read_at")
|
||||||
ordering = ("written_at", "sender")
|
ordering = ("written_at", "sender")
|
||||||
search_fields = ("sender", "recipient", "message_title")
|
search_fields = ("sender", "recipient", "message_title")
|
|
@ -2,4 +2,4 @@ from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
class CommunicationConfig(AppConfig):
|
class CommunicationConfig(AppConfig):
|
||||||
name = "khana.communication"
|
name = "communication"
|
|
@ -1,14 +1,14 @@
|
||||||
"""Configuration et représentation des forms liés aux messages."""
|
"""Configuration et représentation des forms liés aux messages."""
|
||||||
|
|
||||||
|
from datetime import date
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
|
|
||||||
|
from people.models import Gymnast
|
||||||
from .models import Message
|
from .models import Message
|
||||||
|
|
||||||
|
|
||||||
class MessageForm(forms.ModelForm):
|
class MessageForm(forms.ModelForm):
|
||||||
"""Formulaire de base pour la création et la modification de messages
|
|
||||||
"""
|
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Message
|
model = Message
|
||||||
fields = (
|
fields = (
|
|
@ -0,0 +1,65 @@
|
||||||
|
# Generated by Django 3.2.2 on 2021-05-13 10:58
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
|
('communication', '0002_auto_20190413_1028'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='message',
|
||||||
|
old_name='message_body',
|
||||||
|
new_name='body',
|
||||||
|
),
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='message',
|
||||||
|
old_name='date_of_reading',
|
||||||
|
new_name='read_at',
|
||||||
|
),
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='message',
|
||||||
|
old_name='message_title',
|
||||||
|
new_name='title',
|
||||||
|
),
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='message',
|
||||||
|
old_name='date_of_writing',
|
||||||
|
new_name='written_at',
|
||||||
|
),
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='message',
|
||||||
|
name='is_read',
|
||||||
|
),
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='message',
|
||||||
|
name='reader',
|
||||||
|
),
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='message',
|
||||||
|
name='writer',
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='message',
|
||||||
|
name='content',
|
||||||
|
field=models.TextField(blank=True, help_text='Seul le MarkDown simple est accepté', null=True, verbose_name='Comments'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='message',
|
||||||
|
name='recipient',
|
||||||
|
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='received_messages', to='auth.user'),
|
||||||
|
preserve_default=False,
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='message',
|
||||||
|
name='sender',
|
||||||
|
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='sent_messages', to='auth.user'),
|
||||||
|
preserve_default=False,
|
||||||
|
),
|
||||||
|
]
|
|
@ -1,22 +1,9 @@
|
||||||
"""Modelisation de tout ce qui touche à la communication entre utilisateurs.
|
|
||||||
|
|
||||||
Cette application gère:
|
|
||||||
|
|
||||||
* Les messages
|
|
||||||
* Ah, c'est tout en fait :-)
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
from datetime import datetime
|
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.contrib.auth import get_user_model
|
from django.contrib.auth.models import User
|
||||||
|
from datetime import datetime
|
||||||
from khana.base.models import Markdownizable
|
|
||||||
|
|
||||||
|
|
||||||
User = get_user_model()
|
|
||||||
|
|
||||||
|
from base.models import Markdownizable
|
||||||
|
|
||||||
class Message(Markdownizable):
|
class Message(Markdownizable):
|
||||||
"""Représente un message échangé entre deux utilisateurs.
|
"""Représente un message échangé entre deux utilisateurs.
|
||||||
|
@ -33,11 +20,13 @@ class Message(Markdownizable):
|
||||||
sender = models.ForeignKey(
|
sender = models.ForeignKey(
|
||||||
User, on_delete=models.CASCADE, related_name="sent_messages"
|
User, on_delete=models.CASCADE, related_name="sent_messages"
|
||||||
)
|
)
|
||||||
written_at = models.DateTimeField(auto_now_add=True, verbose_name="Date of writing")
|
written_at = models.DateTimeField(
|
||||||
recipient = models.ForeignKey(
|
auto_now_add=True, verbose_name="Date of writing"
|
||||||
User, on_delete=models.CASCADE, related_name="received_messages"
|
)
|
||||||
|
recipient = models.ForeignKey(User, on_delete=models.CASCADE, related_name="received_messages")
|
||||||
|
read_at = models.DateTimeField(
|
||||||
|
auto_now=True, verbose_name="Date of reading"
|
||||||
)
|
)
|
||||||
read_at = models.DateTimeField(auto_now=True, verbose_name="Date of reading")
|
|
||||||
title = models.CharField(max_length=255, verbose_name="Title")
|
title = models.CharField(max_length=255, verbose_name="Title")
|
||||||
body = models.TextField(null=True, blank=True, verbose_name="Message")
|
body = models.TextField(null=True, blank=True, verbose_name="Message")
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
# coding=UTF-8
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
|
from .models import Message
|
||||||
|
from django.contrib.auth.models import User
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
def test_message_tostring():
|
||||||
|
timing = datetime.now()
|
||||||
|
u = User(username='fred', password='fredpassword')
|
||||||
|
m = Message(sender=u, written_at=timing, title="test")
|
||||||
|
assert str(m) == "fred - " + str(timing) + " : test"
|
|
@ -1,6 +1,6 @@
|
||||||
"""Définition des routes d'actions permettant de contrôler les messages et la communication."""
|
"""Définition des routes d'actions permettant de contrôler les messages et la communication."""
|
||||||
|
|
||||||
from django.urls import path
|
from django.urls import path, re_path
|
||||||
|
|
||||||
from . import views
|
from . import views
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
"""Vues et fonctions pour tout ce qui touche à la communication entre plusieurs utilisateurs."""
|
"""Vues et fonctions pour tout ce qui touche à la communication entre plusieurs utilisateurs."""
|
||||||
|
|
||||||
from datetime import datetime
|
|
||||||
|
|
||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
|
from django.contrib.auth.models import User
|
||||||
from django.http import HttpResponse, HttpResponseRedirect
|
from django.http import HttpResponse, HttpResponseRedirect
|
||||||
from django.shortcuts import render, get_object_or_404
|
from django.shortcuts import render, get_object_or_404
|
||||||
from django.views.decorators.http import require_http_methods
|
from django.views.decorators.http import require_http_methods
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
from .forms import MessageForm
|
from .forms import MessageForm
|
||||||
from .models import Message
|
from .models import Message
|
||||||
|
@ -15,35 +15,55 @@ from .models import Message
|
||||||
@login_required
|
@login_required
|
||||||
def get_number_of_unread_message(request):
|
def get_number_of_unread_message(request):
|
||||||
"""Récupère le nombre de messages non lus associés à l'utilisateur en session.
|
"""Récupère le nombre de messages non lus associés à l'utilisateur en session.
|
||||||
"""
|
"""
|
||||||
return (
|
return Message.objects.filter(recipient=request.user).filter(read_at__isnull=True).count()
|
||||||
Message.objects.filter(recipient=request.user)
|
|
||||||
.filter(read_at__isnull=True)
|
|
||||||
.count()
|
@login_required
|
||||||
)
|
@require_http_methods(["GET"])
|
||||||
|
def get_messages(request, message_type="received"):
|
||||||
|
"""Récupère des messages associés l'utilisateur actuellement connecté.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
request (django.http.HttpRequest): (voir mes notes ci-dessous)
|
||||||
|
message_type (str): { received | sent }
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Retourne les messages reçus ou envoyés par l'utilisateur connecté.
|
||||||
|
Si le paramètre `message_type` est vide, la liste renvoyée est vide également.
|
||||||
|
"""
|
||||||
|
if message_type == "received":
|
||||||
|
message_list = request.user.received_messages.all()
|
||||||
|
elif message_type == "sent":
|
||||||
|
message_list = request.user.sent_messages.all()
|
||||||
|
else:
|
||||||
|
message_list = None
|
||||||
|
|
||||||
|
context = {"message_list": message_list, "message_type": message_type}
|
||||||
|
return render(request, "message_list.html", context)
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@require_http_methods(["GET"])
|
@require_http_methods(["GET"])
|
||||||
def get_received_messages(request):
|
def get_received_messages(request):
|
||||||
"""Récupère des messages recus pour l'utilisateur connecté.
|
"""Récupère des messages recus pour l'utilisateur connecté.
|
||||||
"""
|
"""
|
||||||
return request.user.received_messages.all()
|
return get_messages(request, "received")
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@require_http_methods(["GET"])
|
@require_http_methods(["GET"])
|
||||||
def get_sent_messages(request):
|
def get_sent_messages(request):
|
||||||
"""Récupère des messages envoyés par l'utilisateur connecté.
|
"""Récupère des messages envoyés par l'utilisateur connecté.
|
||||||
"""
|
"""
|
||||||
return request.user.sent_messages.all()
|
return get_messages(request, "sent")
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@require_http_methods(["GET"])
|
@require_http_methods(["GET"])
|
||||||
def get_message_details(request, messageid):
|
def get_message_details(request, messageid):
|
||||||
"""Récupère les détails (l'affichage ?) d'un message.
|
"""Récupère les détails (l'affichage ?) d'un message.
|
||||||
"""
|
"""
|
||||||
message = get_object_or_404(Message, pk=messageid)
|
message = get_object_or_404(Message, pk=messageid)
|
||||||
if not message.read_at and message.recipient == request.user.id:
|
if not message.read_at and message.recipient == request.user.id:
|
||||||
message.read_at = datetime.now()
|
message.read_at = datetime.now()
|
||||||
|
@ -57,11 +77,11 @@ def get_message_details(request, messageid):
|
||||||
@require_http_methods(["POST"])
|
@require_http_methods(["POST"])
|
||||||
def delete_message(request, messageid):
|
def delete_message(request, messageid):
|
||||||
"""Supprime le message dont la clé est passée en paramètre.
|
"""Supprime le message dont la clé est passée en paramètre.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
message = Message.objects.get(pk=messageid)
|
message = Message.objects.get(pk=messageid)
|
||||||
|
|
||||||
if message.sender == request.user or message.recipient == request.user:
|
if message.sender == request.user or message.recipient == request.user :
|
||||||
message.delete()
|
message.delete()
|
||||||
else:
|
else:
|
||||||
return HttpResponse(401)
|
return HttpResponse(401)
|
||||||
|
@ -75,7 +95,7 @@ def delete_message(request, messageid):
|
||||||
@require_http_methods(["GET", "POST"])
|
@require_http_methods(["GET", "POST"])
|
||||||
def compose_message(request):
|
def compose_message(request):
|
||||||
"""Permet à l'utilisateur connecté de rédiger un nouveau message.
|
"""Permet à l'utilisateur connecté de rédiger un nouveau message.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
form = MessageForm(request.POST)
|
form = MessageForm(request.POST)
|
||||||
|
@ -83,8 +103,8 @@ def compose_message(request):
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
form.save()
|
form.save()
|
||||||
return HttpResponseRedirect(reverse("sent_messages"))
|
return HttpResponseRedirect(reverse("sent_messages"))
|
||||||
|
else:
|
||||||
print("Invalid form")
|
print("Invalid form")
|
||||||
else:
|
else:
|
||||||
form = MessageForm()
|
form = MessageForm()
|
||||||
|
|
|
@ -15,6 +15,7 @@ class PointAdmin(admin.ModelAdmin):
|
||||||
"total",
|
"total",
|
||||||
)
|
)
|
||||||
ordering = ("gymnast",)
|
ordering = ("gymnast",)
|
||||||
|
# search_fields = ('longLabel', 'shortLabel')
|
||||||
list_filter = ("gymnast", "event", "routine_type")
|
list_filter = ("gymnast", "event", "routine_type")
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# coding=UTF-8
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
|
@ -13,6 +14,7 @@ class Point(models.Model):
|
||||||
"people.Gymnast", on_delete=models.CASCADE, default=None
|
"people.Gymnast", on_delete=models.CASCADE, default=None
|
||||||
)
|
)
|
||||||
event = models.ForeignKey("planning.Event", 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)
|
routine_type = models.PositiveSmallIntegerField(choices=ROUTINETYPE_CHOICE)
|
||||||
point_execution = models.DecimalField(max_digits=5, decimal_places=3)
|
point_execution = models.DecimalField(max_digits=5, decimal_places=3)
|
||||||
point_difficulty = models.DecimalField(max_digits=3, decimal_places=1)
|
point_difficulty = models.DecimalField(max_digits=3, decimal_places=1)
|
||||||
|
@ -22,8 +24,9 @@ class Point(models.Model):
|
||||||
total = models.DecimalField(max_digits=6, decimal_places=3)
|
total = models.DecimalField(max_digits=6, decimal_places=3)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "%s - %s" % (
|
return "%s, %s - %s" % (
|
||||||
self.gymnast,
|
self.gymnast.lastname,
|
||||||
|
self.gymnast.firstname,
|
||||||
self.total,
|
self.total,
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
# coding=UTF-8
|
# coding=UTF-8
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from .models import Point, Competition, Division, Level
|
from .models import (
|
||||||
|
Point,
|
||||||
|
Competition,
|
||||||
|
Division,
|
||||||
|
Level
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# class TestModelCompetition(TestCase):
|
# class TestModelCompetition(TestCase):
|
||||||
|
@ -9,7 +14,6 @@ from .models import Point, Competition, Division, Level
|
||||||
# Tests relatifs à la classe `Compétition`.
|
# Tests relatifs à la classe `Compétition`.
|
||||||
# """
|
# """
|
||||||
|
|
||||||
|
|
||||||
def test_competition_str_():
|
def test_competition_str_():
|
||||||
""" Vérifie la représentation textuelle de la classe. """
|
""" Vérifie la représentation textuelle de la classe. """
|
||||||
competition = Competition(name="Belgian Open Trampoline", acronym="BOT")
|
competition = Competition(name="Belgian Open Trampoline", acronym="BOT")
|
||||||
|
@ -21,7 +25,6 @@ def test_competition_str_():
|
||||||
# Tests relatifs à la classe `Division`.
|
# Tests relatifs à la classe `Division`.
|
||||||
# """
|
# """
|
||||||
|
|
||||||
|
|
||||||
def test_division_str_():
|
def test_division_str_():
|
||||||
""" Vérifie la représentation textuelle de la classe. """
|
""" Vérifie la représentation textuelle de la classe. """
|
||||||
competition = Competition(name="Belgian Open Trampoline", acronym="BOT")
|
competition = Competition(name="Belgian Open Trampoline", acronym="BOT")
|
||||||
|
@ -34,7 +37,6 @@ def test_division_str_():
|
||||||
# Tests relatifs à la classe `Level`.
|
# Tests relatifs à la classe `Level`.
|
||||||
# """
|
# """
|
||||||
|
|
||||||
|
|
||||||
def test_level_str_():
|
def test_level_str_():
|
||||||
""" Vérifie la représentation textuelle de la classe. """
|
""" Vérifie la représentation textuelle de la classe. """
|
||||||
competition = Competition(name="Belgian Open Trampoline", acronym="BOT")
|
competition = Competition(name="Belgian Open Trampoline", acronym="BOT")
|
|
@ -1,3 +1,4 @@
|
||||||
|
# coding=UTF-8
|
||||||
|
|
||||||
from django.shortcuts import render, get_object_or_404
|
from django.shortcuts import render, get_object_or_404
|
||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
|
@ -5,10 +6,9 @@ from django.http import HttpResponse, HttpResponseRedirect
|
||||||
from django.views.decorators.http import require_http_methods
|
from django.views.decorators.http import require_http_methods
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
|
|
||||||
from khana.people.models import Gymnast
|
|
||||||
|
|
||||||
from .forms import ScoreForm
|
from .forms import ScoreForm
|
||||||
from .models import Point
|
from .models import Point
|
||||||
|
from people.models import Gymnast
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
|
@ -10,51 +10,54 @@ For the full list of settings and their values, see
|
||||||
https://docs.djangoproject.com/en/1.8/ref/settings/
|
https://docs.djangoproject.com/en/1.8/ref/settings/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||||
import os
|
import os
|
||||||
import environ
|
import environ
|
||||||
|
|
||||||
from pathlib import Path
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
|
||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
env = environ.Env(
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
DEBUG=(bool, False)
|
||||||
|
)
|
||||||
env = environ.Env(DEBUG=(bool, False))
|
|
||||||
|
|
||||||
environ.Env.read_env()
|
environ.Env.read_env()
|
||||||
|
|
||||||
DEBUG = env("DEBUG", default=True)
|
DEBUG = env('DEBUG', default=True)
|
||||||
|
|
||||||
SECRET_KEY = env(
|
SECRET_KEY = env('SECRET_KEY', default="6@9p0g-5ebcttbt$^*s4rda5!piezt6b7wj35g(+$mgz52k#d=")
|
||||||
"SECRET_KEY", default="6@9p0g-5ebcttbt$^*s4rda5!piezt6b7wj35g(+$mgz52k#d="
|
|
||||||
)
|
|
||||||
|
|
||||||
DATABASES = {"default": env.db("DATABASE_URL", default="sqlite:///db.sqlite3")}
|
DATABASES = {
|
||||||
|
'default': env.db('DATABASE_URL', default='sqlite:///db.sqlite3')
|
||||||
|
}
|
||||||
|
|
||||||
|
# Quick-start development settings - unsuitable for production
|
||||||
|
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
|
||||||
ALLOWED_HOSTS = ["*"]
|
ALLOWED_HOSTS = ["*"]
|
||||||
|
|
||||||
|
|
||||||
|
# Application definition
|
||||||
INSTALLED_APPS = (
|
INSTALLED_APPS = (
|
||||||
"django.contrib.contenttypes",
|
"django.contrib.contenttypes",
|
||||||
"django.contrib.admin",
|
"django.contrib.admin",
|
||||||
|
# 'django.contrib.admindocs',
|
||||||
"django.contrib.auth",
|
"django.contrib.auth",
|
||||||
"django.contrib.sessions",
|
"django.contrib.sessions",
|
||||||
"django.contrib.messages",
|
"django.contrib.messages",
|
||||||
"django.contrib.staticfiles",
|
"django.contrib.staticfiles",
|
||||||
"django_extensions",
|
"django_extensions",
|
||||||
"khana.people",
|
"people",
|
||||||
"khana.location",
|
"location",
|
||||||
"khana.planning",
|
"planning",
|
||||||
"khana.objective",
|
"objective",
|
||||||
"khana.competition",
|
"competition",
|
||||||
"khana.profile",
|
"profile",
|
||||||
"khana.tools",
|
"tools",
|
||||||
"khana.communication",
|
"communication",
|
||||||
"rest_framework",
|
"rest_framework",
|
||||||
)
|
)
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
"django.middleware.security.SecurityMiddleware",
|
"django.middleware.security.SecurityMiddleware",
|
||||||
"whitenoise.middleware.WhiteNoiseMiddleware",
|
|
||||||
"django.contrib.sessions.middleware.SessionMiddleware",
|
"django.contrib.sessions.middleware.SessionMiddleware",
|
||||||
"django.middleware.common.CommonMiddleware",
|
"django.middleware.common.CommonMiddleware",
|
||||||
#'django.middleware.csrf.CsrfViewMiddleware',
|
#'django.middleware.csrf.CsrfViewMiddleware',
|
||||||
|
@ -63,7 +66,7 @@ MIDDLEWARE = [
|
||||||
#'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
#'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||||
]
|
]
|
||||||
|
|
||||||
ROOT_URLCONF = "config.urls"
|
ROOT_URLCONF = "khana.urls"
|
||||||
|
|
||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
{
|
{
|
||||||
|
@ -104,20 +107,19 @@ LOGIN_URL = "/login/"
|
||||||
|
|
||||||
LOGOUT_URL = "/logout/"
|
LOGOUT_URL = "/logout/"
|
||||||
|
|
||||||
MEDIA_URL = "/media/" # https://media.khana.be
|
# Static files (CSS, JavaScript, Images)
|
||||||
|
# https://docs.djangoproject.com/en/1.8/howto/static-files/
|
||||||
MEDIA_ROOT = os.path.join(BASE_DIR, "media")
|
|
||||||
|
|
||||||
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
|
|
||||||
|
|
||||||
STATIC_URL = "/static/"
|
STATIC_URL = "/static/"
|
||||||
|
|
||||||
STATICFILES_DIRS = (os.path.join(BASE_DIR, "static"),)
|
STATICFILES_DIRS = (os.path.join(BASE_DIR, "static"),)
|
||||||
|
|
||||||
STATIC_ROOT = BASE_DIR / 'staticfiles'
|
MEDIA_URL = "/media/" # https://media.khana.be
|
||||||
|
|
||||||
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
|
MEDIA_ROOT = os.path.join(BASE_DIR, "media")
|
||||||
|
|
||||||
DEBUG_TOOLBAR_CONFIG = {
|
DEBUG_TOOLBAR_CONFIG = {
|
||||||
"JQUERY_URL": STATIC_URL + "js/jquery-2.1.4.min.js",
|
"JQUERY_URL": STATIC_URL + "js/jquery-2.1.4.min.js",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
|
|
@ -17,22 +17,21 @@ Including another URLconf
|
||||||
from django.urls import include, path
|
from django.urls import include, path
|
||||||
from django.conf.urls.static import static
|
from django.conf.urls.static import static
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
from khana import settings
|
||||||
|
|
||||||
from config import settings
|
import khana.views
|
||||||
|
import planning.views
|
||||||
|
import people.views
|
||||||
|
import objective.views
|
||||||
|
import location.views
|
||||||
|
|
||||||
import config.views
|
import location.urls
|
||||||
import khana.planning.views
|
import people.urls
|
||||||
import khana.people.views
|
import objective.urls
|
||||||
import khana.objective.views
|
import planning.urls
|
||||||
import khana.location.views
|
import competition.urls
|
||||||
|
import profile.urls
|
||||||
import khana.location.urls
|
import communication.urls
|
||||||
import khana.people.urls
|
|
||||||
import khana.objective.urls
|
|
||||||
import khana.planning.urls
|
|
||||||
import khana.competition.urls
|
|
||||||
import khana.profile.urls
|
|
||||||
import khana.communication.urls
|
|
||||||
|
|
||||||
# import planningline_urlpatterns
|
# import planningline_urlpatterns
|
||||||
|
|
||||||
|
@ -46,45 +45,45 @@ urlpatterns = [
|
||||||
path(r"admin/", admin.site.urls),
|
path(r"admin/", admin.site.urls),
|
||||||
# url(r'^admin/jsi18n/$', include('django.views.i18n.javascript_catalog')), # pour le "ModelMultipleChoiceField" de event.forms
|
# url(r'^admin/jsi18n/$', include('django.views.i18n.javascript_catalog')), # pour le "ModelMultipleChoiceField" de event.forms
|
||||||
# Profile list
|
# Profile list
|
||||||
path(r"profile/", include(khana.profile.urls.profile_urlpatterns)),
|
path(r"profile/", include(profile.urls.profile_urlpatterns)),
|
||||||
# Attendance list
|
# Attendance list
|
||||||
path(r"attendance/", include(khana.planning.urls.attendance_urlpatterns)),
|
path(r"attendance/", include(planning.urls.attendance_urlpatterns)),
|
||||||
# About competition
|
# About competition
|
||||||
path(r"score/", include(khana.competition.urls.score_urlpatterns)),
|
path(r"score/", include(competition.urls.score_urlpatterns)),
|
||||||
# About gymnast
|
# About gymnast
|
||||||
path(r"gymnast/", include(khana.people.urls.people_urlpatterns)),
|
path(r"gymnast/", include(people.urls.people_urlpatterns)),
|
||||||
# About event
|
# About event
|
||||||
path(r"event/", include(khana.planning.urls.event_urlpatterns)),
|
path(r"event/", include(planning.urls.event_urlpatterns)),
|
||||||
# About skill
|
# About skill
|
||||||
path(r"skill/", include(khana.objective.urls.skill_urlpatterns)),
|
path(r"skill/", include(objective.urls.skill_urlpatterns)),
|
||||||
# About chrono
|
# About chrono
|
||||||
path(r"chrono/", include(khana.objective.urls.chrono_urlpatterns)),
|
path(r"chrono/", include(objective.urls.chrono_urlpatterns)),
|
||||||
# About skill
|
# About skill
|
||||||
path(r"training/", include(khana.planning.urls.training_urlpatterns)),
|
path(r"training/", include(planning.urls.training_urlpatterns)),
|
||||||
# About routine
|
# About routine
|
||||||
path(r"routine/", include(khana.objective.urls.routine_urlpatterns)),
|
path(r"routine/", include(objective.urls.routine_urlpatterns)),
|
||||||
# About accident
|
# About accident
|
||||||
path(r"accident/", include(khana.people.urls.accident_urlpatterns)),
|
path(r"accident/", include(people.urls.accident_urlpatterns)),
|
||||||
# About unavailability
|
# About unavailability
|
||||||
path(r"unavailability/", include(khana.planning.urls.unavailability_urlpatterns)),
|
path(r"unavailability/", include(planning.urls.unavailability_urlpatterns)),
|
||||||
# About planningline
|
# About planningline
|
||||||
path(r"program/", include(khana.planning.urls.planningline_urlpatterns)),
|
path(r"program/", include(planning.urls.planningline_urlpatterns)),
|
||||||
# About course
|
# About course
|
||||||
path(r"course/", include(khana.planning.urls.course_urlpatterns)),
|
path(r"course/", include(planning.urls.course_urlpatterns)),
|
||||||
path(r"messages/", include(khana.communication.urls.message_urlpatterns)),
|
path(r"messages/", include(communication.urls.message_urlpatterns)),
|
||||||
# About Location
|
# About Location
|
||||||
path(r"place/", include(khana.location.urls.place_urlpatterns)),
|
path(r"place/", include(location.urls.place_urlpatterns)),
|
||||||
path(r"country/", include(khana.location.urls.country_urlpatterns)),
|
path(r"country/", include(location.urls.country_urlpatterns)),
|
||||||
path(r"club/", include(khana.location.urls.club_urlpatterns)),
|
path(r"club/", include(location.urls.club_urlpatterns)),
|
||||||
# url(r'^club/', location.views.chooseStatistics),
|
# url(r'^club/', location.views.chooseStatistics),
|
||||||
# url(r'^club/(?P<clubid>[0-9]+)', location.views.club_statistics),
|
# url(r'^club/(?P<clubid>[0-9]+)', location.views.club_statistics),
|
||||||
# Global search
|
# Global search
|
||||||
path(r"search/", config.views.search, name="global_search"),
|
path(r"search/", khana.views.search, name="global_search"),
|
||||||
# login & logout
|
# login & logout
|
||||||
path(r"login/", config.views.login, name="login"),
|
path(r"login/", khana.views.login, name="login"),
|
||||||
path(r"logout/", config.views.logout, name="logout"),
|
path(r"logout/", khana.views.logout, name="logout"),
|
||||||
# Home page
|
# Home page
|
||||||
path(r"", config.views.home, name="home"),
|
path(r"", khana.views.home, name="home"),
|
||||||
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||||
|
|
||||||
# if settings.DEBUG:
|
# if settings.DEBUG:
|
|
@ -1,8 +1,4 @@
|
||||||
|
# coding=UTF-8
|
||||||
from datetime import datetime, timedelta, date
|
|
||||||
from functools import reduce
|
|
||||||
import operator
|
|
||||||
|
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from django.template import RequestContext
|
from django.template import RequestContext
|
||||||
|
@ -13,20 +9,23 @@ from django.http import HttpResponseRedirect
|
||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
from django.views.decorators.http import require_http_methods
|
from django.views.decorators.http import require_http_methods
|
||||||
|
|
||||||
import pendulum
|
from datetime import datetime, timedelta, date
|
||||||
|
from functools import reduce
|
||||||
|
import operator
|
||||||
|
|
||||||
from khana.planning.models import (
|
from planning.models import (
|
||||||
Season,
|
Season,
|
||||||
Event,
|
Event,
|
||||||
Unavailability,
|
Unavailability,
|
||||||
Course,
|
Course,
|
||||||
get_number_of_weeks_between,
|
get_number_of_weeks_between,
|
||||||
)
|
)
|
||||||
from khana.people.models import Gymnast, Accident # people model
|
from people.models import Gymnast, Accident # people model
|
||||||
from khana.location.models import Club # location model
|
from location.models import Club # location model
|
||||||
from khana.objective.models import Skill, Routine # objective model
|
from objective.models import Skill, Routine # objective model
|
||||||
from khana.profile.models import Profile
|
from profile.models import Profile
|
||||||
from khana.communication.views import get_number_of_unread_message
|
from communication.views import get_number_of_unread_message
|
||||||
|
import pendulum
|
||||||
|
|
||||||
|
|
||||||
def login(request):
|
def login(request):
|
||||||
|
@ -50,7 +49,7 @@ def login(request):
|
||||||
request.session["template"] = profile.template_color
|
request.session["template"] = profile.template_color
|
||||||
request.session["sidebar"] = profile.sidebar_color
|
request.session["sidebar"] = profile.sidebar_color
|
||||||
request.session["is_sidebar_minified"] = profile.is_sidebar_minified
|
request.session["is_sidebar_minified"] = profile.is_sidebar_minified
|
||||||
except Exception:
|
except expression as identifier:
|
||||||
pass
|
pass
|
||||||
request.session["clubid"] = request.POST.get("clubid", None)
|
request.session["clubid"] = request.POST.get("clubid", None)
|
||||||
return HttpResponseRedirect("/")
|
return HttpResponseRedirect("/")
|
||||||
|
@ -160,10 +159,10 @@ def home(request):
|
||||||
try:
|
try:
|
||||||
season = Season.objects.get(datebegin__lte=today, dateend__gte=today)
|
season = Season.objects.get(datebegin__lte=today, dateend__gte=today)
|
||||||
except Season.DoesNotExist:
|
except Season.DoesNotExist:
|
||||||
context = {"error": "No season found."}
|
context = {"error": "No season founded."}
|
||||||
return render(request, "index.html", context)
|
return render(request, "index.html", context)
|
||||||
except Season.MultipleObjectsReturned:
|
except Season.MultipleObjectsReturned:
|
||||||
context = {"error": "Multiple season found."}
|
context = {"error": "Multiple season founded."}
|
||||||
return render(request, "index.html", context)
|
return render(request, "index.html", context)
|
||||||
|
|
||||||
week_number = season.week_number_from_begin(today)
|
week_number = season.week_number_from_begin(today)
|
||||||
|
@ -247,8 +246,7 @@ def search(request):
|
||||||
name__icontains=pattern
|
name__icontains=pattern
|
||||||
) # ou gymnaste qui y participe !
|
) # ou gymnaste qui y participe !
|
||||||
gymnast_list = Gymnast.objects.filter(
|
gymnast_list = Gymnast.objects.filter(
|
||||||
Q(user__last_name__icontains=pattern)
|
Q(user__last_name__icontains=pattern) | Q(user__first_name__icontains=pattern)
|
||||||
| Q(user__first_name__icontains=pattern)
|
|
||||||
)
|
)
|
||||||
accident_list = Accident.objects.filter(
|
accident_list = Accident.objects.filter(
|
||||||
Q(gymnast__user__last_name__icontains=pattern)
|
Q(gymnast__user__last_name__icontains=pattern)
|
|
@ -11,6 +11,6 @@ import os
|
||||||
|
|
||||||
from django.core.wsgi import get_wsgi_application
|
from django.core.wsgi import get_wsgi_application
|
||||||
|
|
||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "khana.settings")
|
||||||
|
|
||||||
application = get_wsgi_application()
|
application = get_wsgi_application()
|
|
@ -4,10 +4,8 @@ from django.db import models
|
||||||
|
|
||||||
|
|
||||||
class Country(models.Model):
|
class Country(models.Model):
|
||||||
"""Classe représentant les pays (basée sur la liste ISO 3166 de 2015).
|
"""
|
||||||
|
Classe représentant les pays (basée sur la liste ISO 3166 de 2015).
|
||||||
References:
|
|
||||||
https://fr.wikipedia.org/wiki/ISO_3166
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -48,7 +46,7 @@ class Place(models.Model):
|
||||||
active = models.BooleanField(default=1, verbose_name="Active")
|
active = models.BooleanField(default=1, verbose_name="Active")
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "%s (%s)" % (self.name, self.city if self.city else "?")
|
return "%s (%s)" % (self.name, self.city)
|
||||||
|
|
||||||
|
|
||||||
class Club(models.Model):
|
class Club(models.Model):
|
||||||
|
@ -72,4 +70,4 @@ class Club(models.Model):
|
||||||
active = models.BooleanField(default=1, verbose_name="Active")
|
active = models.BooleanField(default=1, verbose_name="Active")
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "%s (à %s)" % (self.name, self.place.city if self.place.city else "?")
|
return "%s (à %s)" % (self.name, self.place.city)
|
|
@ -1,6 +1,10 @@
|
||||||
# coding=UTF-8
|
# coding=UTF-8
|
||||||
|
|
||||||
from .models import Club, Place, Country
|
from .models import (
|
||||||
|
Club,
|
||||||
|
Place,
|
||||||
|
Country
|
||||||
|
)
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
# class GymnastTestCase():
|
# class GymnastTestCase():
|
||||||
|
@ -8,13 +12,11 @@ def test_country_tostring():
|
||||||
c = Country(namefr="Belgique", iso2="56")
|
c = Country(namefr="Belgique", iso2="56")
|
||||||
assert str(c) == "Belgique (56)"
|
assert str(c) == "Belgique (56)"
|
||||||
|
|
||||||
|
|
||||||
def test_place_tostring():
|
def test_place_tostring():
|
||||||
p = Place(name="FATC", city="Lillois")
|
p = Place(name="FATC", city="Lillois")
|
||||||
assert str(p) == "FATC (Lillois)"
|
assert str(p) == "FATC (Lillois)"
|
||||||
|
|
||||||
|
|
||||||
def test_club_tostring():
|
def test_club_tostring():
|
||||||
p = Place(name="FATC", city="Lillois")
|
p = Place(name="FATC", city="Lillois")
|
||||||
club = Club(place=p, name="FATC2")
|
club = Club(place=p, name="FATC2")
|
||||||
assert str(club) == "FATC2 (à Lillois)"
|
assert str(club) == "FATC2 (à Lillois)"
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue