diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f420a9f5..f2635b7b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,6 +32,9 @@ before_script: - apt-get update -q && apt-get -o dir::cache::archives="vendor/apt" install -yqq mysql-client - mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host="$DBHOST" -e "GRANT ALL ON test_$DBNAME.* TO '$DBUSER'@'%'" + # Remove the old test database if it has not been done yet + - mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host="$DBHOST" + -e "DROP DATABASE test_$DBNAME" || true - pip install --cache-dir vendor/pip -t vendor/python -r requirements-devel.txt test: diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..1af5efa7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 cof-geek + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index e7056f1e..1a3d575e 100644 --- a/README.md +++ b/README.md @@ -84,29 +84,30 @@ visualiser la dernière version du code. Si vous optez pour une installation manuelle plutôt que d'utiliser Vagrant, il est fortement conseillé d'utiliser un environnement virtuel pour Python. -Il vous faudra installer mercurial, pip, les librairies de développement de -python, un client et un serveur MySQL ainsi qu'un serveur redis ; sous Debian et -dérivées (Ubuntu, ...) : +Il vous faudra installer pip, les librairies de développement de python, un +client et un serveur MySQL ainsi qu'un serveur redis ; sous Debian et dérivées +(Ubuntu, ...) : - sudo apt-get install mercurial python-pip python-dev libmysqlclient-dev - redis-server + sudo apt-get install python-pip python-dev libmysqlclient-dev redis-server Si vous décidez d'utiliser un environnement virtuel Python (virtualenv; fortement conseillé), déplacez-vous dans le dossier où est installé GestioCOF (le dossier où se trouve ce README), et créez-le maintenant : - virtualenv env + virtualenv env -p $(which python3) -Pour l'activer, il faut faire +L'option `-p` sert à préciser l'exécutable python à utiliser. Vous devez choisir +python3, si c'est la version de python par défaut sur votre système, ceci n'est +pas nécessaire. Pour l'activer, il faut faire . env/bin/activate dans le même dossier. -Vous pouvez maintenant installer les dépendances Python depuis les fichiers -`requirements.txt` et `requirements-devel.txt` : +Vous pouvez maintenant installer les dépendances Python depuis le fichier +`requirements-devel.txt` : - pip install -r requirements.txt -r requirements-devel.txt + pip install -r requirements-devel.txt Copiez le fichier `cof/settings_dev.py` dans `cof/settings.py`. @@ -170,10 +171,14 @@ Il ne vous reste plus qu'à initialiser les modèles de Django avec la commande python manage.py migrate +Charger les mails indispensables au bon fonctionnement de GestioCOF : -Une base de donnée pré-remplie est disponible en lançant la commande : + python manage.py syncmails - python manage.py loaddata users root bda gestion sites accounts groups articles +Une base de donnée pré-remplie est disponible en lançant les commandes : + + python manage.py loaddata gestion sites accounts groups articles + python manage.py loaddevdata Vous êtes prêts à développer ! Lancer GestioCOF en faisant diff --git a/bda/admin.py b/bda/admin.py index 0e9b683b..fc10c326 100644 --- a/bda/admin.py +++ b/bda/admin.py @@ -1,10 +1,9 @@ # -*- coding: utf-8 -*- -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals +import autocomplete_light +from datetime import timedelta +from custommail.shortcuts import send_mass_custom_mail -from django.core.mail import send_mail from django.contrib import admin from django.db.models import Sum, Count from django.template.defaultfilters import pluralize @@ -13,10 +12,6 @@ from django import forms from bda.models import Spectacle, Salle, Participant, ChoixSpectacle,\ Attribution, Tirage, Quote, CategorieSpectacle, SpectacleRevente -from datetime import timedelta - -import autocomplete_light - class ChoixSpectacleInline(admin.TabularInline): model = ChoixSpectacle @@ -72,66 +67,20 @@ class ParticipantAdmin(admin.ModelAdmin): readonly_fields = ("total",) def send_attribs(self, request, queryset): + datatuple = [] for member in queryset.all(): attribs = member.attributions.all() + context = {'member': member.user} + shortname = "" if len(attribs) == 0: - mail = """Cher-e %s, - -Tu t'es inscrit-e pour le tirage au sort du BdA. Malheureusement, tu n'as -obtenu aucune place. - -Nous proposons cependant de nombreuses offres hors-tirage tout au long de -l'année, et nous t'invitons à nous contacter si l'une d'entre elles -t'intéresse ! --- -Le Bureau des Arts - -""" - name = member.user.get_full_name() - mail = mail % name + shortname = "bda-attributions-decus" else: - mail = """Cher-e %s, - -Tu t'es inscrit-e pour le tirage au sort du BdA. Tu as été sélectionné-e -pour les spectacles suivants : - -%s - -*Paiement* -L'intégralité de ces places de spectacles est à régler dès maintenant et AVANT -le %s, au bureau du COF pendant les heures de permanences (du lundi au vendredi -entre 12h et 14h, et entre 18h et 20h). Des facilités de paiement sont bien -évidemment possibles : nous pouvons ne pas encaisser le chèque immédiatement, -ou bien découper votre paiement en deux fois. Pour ceux qui ne pourraient pas -venir payer au bureau, merci de nous contacter par mail. - -*Mode de retrait des places* -Au moment du paiement, certaines places vous seront remises directement, -d'autres seront à récupérer au cours de l'année, d'autres encore seront -nominatives et à retirer le soir même dans les theâtres correspondants. -Pour chaque spectacle, vous recevrez un mail quelques jours avant la -représentation vous indiquant le mode de retrait. - -Nous vous rappelons que l'obtention de places du BdA vous engage à -respecter les règles de fonctionnement : -http://www.cof.ens.fr/bda/?page_id=1370 -Le système de revente des places via les mails BdA-revente sera très -prochainement disponible, directement sur votre compte GestioCOF. - -En vous souhaitant de très beaux spectacles tout au long de l'année, --- -Le Bureau des Arts -""" - attribs_text = "" - name = member.user.get_full_name() - for attrib in attribs: - attribs_text += "- 1 place pour %s\n" % attrib - deadline = member.tirage.fermeture + timedelta(days=7) - mail = mail % (name, attribs_text, - deadline.strftime('%d %b %Y')) - send_mail("Résultats du tirage au sort", mail, - "bda@ens.fr", [member.user.email], - fail_silently=True) + shortname = "bda-attributions" + context['places'] = attribs + print(context) + datatuple.append((shortname, context, "bda@ens.fr", + [member.user.email])) + send_mass_custom_mail(datatuple) count = len(queryset.all()) if count == 1: message_bit = "1 membre a" diff --git a/bda/fixtures/bda.json b/bda/fixtures/bda.json deleted file mode 100644 index bb9fd73d..00000000 --- a/bda/fixtures/bda.json +++ /dev/null @@ -1,7616 +0,0 @@ -[ -{ - "fields": { - "active": true, - "tokens": "", - "ouverture": "2016-06-14T10:00:00Z", - "fermeture": "2016-07-31T22:59:00Z", - "title": "Tirage de test 1" - }, - "model": "bda.tirage", - "pk": 1 -}, -{ - "fields": { - "active": true, - "tokens": "", - "ouverture": "2016-06-14T10:00:00Z", - "fermeture": "2016-09-01T22:59:00Z", - "title": "Tirage de test 2" - }, - "model": "bda.tirage", - "pk": 2 -}, -{ - "fields": { - "name": "Cour\u00f4", - "address": "45 rue d'Ulm, cour\u00f4" - }, - "model": "bda.salle", - "pk": 1 -}, -{ - "fields": { - "name": "K-F\u00eat", - "address": "45 rue d'Ulm, escalier C, niveau -1" - }, - "model": "bda.salle", - "pk": 2 -}, -{ - "fields": { - "name": "Th\u00e9\u00e2tre", - "address": "45 rue d'Ulm, escalier C, niveau -1" - }, - "model": "bda.salle", - "pk": 3 -}, -{ - "fields": { - "name": "Cours Pasteur", - "address": "45 rue d'Ulm, cours pasteur" - }, - "model": "bda.salle", - "pk": 4 -}, -{ - "fields": { - "name": "Salle des actes", - "address": "45 rue d'Ulm, escalier A, niveau 1" - }, - "model": "bda.salle", - "pk": 5 -}, -{ - "fields": { - "name": "Amphi Rataud", - "address": "45 rue d'Ulm, NIR, niveau PB" - }, - "model": "bda.salle", - "pk": 6 -}, -{ - "fields": { - "description": "Jazz / Funk", - "title": "Un super concert", - "price": 10.0, - "rappel_sent": null, - "location": 2, - "date": "2016-09-30T18:00:00Z", - "slots_description": "Debout", - "slots": 5, - "listing": false, - "tirage": 1 - }, - "model": "bda.spectacle", - "pk": 1 -}, -{ - "fields": { - "description": "Homemade", - "title": "Une super pi\u00e8ce", - "price": 10.0, - "rappel_sent": null, - "location": 3, - "date": "2016-09-29T14:00:00Z", - "slots_description": "Assises", - "slots": 60, - "listing": true, - "tirage": 1 - }, - "model": "bda.spectacle", - "pk": 2 -}, -{ - "fields": { - "description": "Plein air, soleil, bonne musique", - "title": "Concert pour la f\u00eate de la musique", - "price": 5.0, - "rappel_sent": null, - "location": 1, - "date": "2016-09-21T15:00:00Z", - "slots_description": "Debout, attention \u00e0 la fontaine", - "slots": 30, - "listing": false, - "tirage": 1 - }, - "model": "bda.spectacle", - "pk": 3 -}, -{ - "fields": { - "description": "Sous le regard s\u00e9v\u00e8re de Louis Pasteur", - "title": "Op\u00e9ra sans d\u00e9cors", - "price": 5.0, - "rappel_sent": null, - "location": 4, - "date": "2016-10-06T19:00:00Z", - "slots_description": "Assis sur l'herbe", - "slots": 20, - "listing": false, - "tirage": 1 - }, - "model": "bda.spectacle", - "pk": 4 -}, -{ - "fields": { - "description": "Buffet \u00e0 la fin", - "title": "Concert Trouv\u00e8re", - "price": 20.0, - "rappel_sent": null, - "location": 5, - "date": "2016-11-30T12:00:00Z", - "slots_description": "Assises", - "slots": 15, - "listing": false, - "tirage": 1 - }, - "model": "bda.spectacle", - "pk": 5 -}, -{ - "fields": { - "description": "Vive les maths", - "title": "Dessin \u00e0 la craie sur tableau noir", - "price": 10.0, - "rappel_sent": null, - "location": 6, - "date": "2016-12-15T07:00:00Z", - "slots_description": "Assises, tablette pour prendre des notes", - "slots": 30, - "listing": true, - "tirage": 2 - }, - "model": "bda.spectacle", - "pk": 6 -}, -{ - "fields": { - "description": "Une pi\u00e8ce \u00e0 un personnage", - "title": "D\u00e9cors, d\u00e9montage en musique", - "price": 0.0, - "rappel_sent": null, - "location": 3, - "date": "2016-12-26T07:00:00Z", - "slots_description": "Assises", - "slots": 20, - "listing": false, - "tirage": 2 - }, - "model": "bda.spectacle", - "pk": 7 -}, -{ - "fields": { - "description": "Annulera, annulera pas\u00a0?", - "title": "La Nuit", - "price": 27.0, - "rappel_sent": null, - "location": 1, - "date": "2016-11-14T23:00:00Z", - "slots_description": "", - "slots": 1000, - "listing": true, - "tirage": 2 - }, - "model": "bda.spectacle", - "pk": 8 -}, -{ - "fields": { - "description": "Le boum fait sa carte blanche", - "title": "Turbomix", - "price": 10.0, - "rappel_sent": null, - "location": 2, - "date": "2017-01-10T20:00:00Z", - "slots_description": "Debout les mains en l'air", - "slots": 20, - "listing": true, - "tirage": 2 - }, - "model": "bda.spectacle", - "pk": 9 -}, -{ - "fields": { - "description": "Unique repr\u00e9sentation", - "title": "Carinettes et trombone", - "price": 15.0, - "rappel_sent": null, - "location": 5, - "date": "2017-01-02T14:00:00Z", - "slots_description": "Chaises ikea", - "slots": 10, - "listing": false, - "tirage": 1 - }, - "model": "bda.spectacle", - "pk": 10 -}, -{ - "fields": { - "description": "Suivi d'une jam session", - "title": "Percussion sur rondins", - "price": 5.0, - "rappel_sent": null, - "location": 4, - "date": "2017-01-13T14:00:00Z", - "slots_description": "B\u00fbches", - "slots": 14, - "listing": true, - "tirage": 2 - }, - "model": "bda.spectacle", - "pk": 11 -}, -{ - "fields": { - "description": "\u00c9preuve sportive et artistique", - "title": "Bassin aux ernests, nage libre", - "price": 5.0, - "rappel_sent": null, - "location": 1, - "date": "2016-11-17T09:00:00Z", - "slots_description": "Humides", - "slots": 10, - "listing": false, - "tirage": 1 - }, - "model": "bda.spectacle", - "pk": 12 -}, -{ - "fields": { - "description": "Sonore", - "title": "Chant du barde", - "price": 13.0, - "rappel_sent": null, - "location": 2, - "date": "2017-02-26T07:00:00Z", - "slots_description": "Ne venez pas", - "slots": 20, - "listing": false, - "tirage": 2 - }, - "model": "bda.spectacle", - "pk": 13 -}, -{ - "fields": { - "description": "Cocorico", - "title": "Chant du coq", - "price": 4.0, - "rappel_sent": null, - "location": 1, - "date": "2016-12-17T04:00:00Z", - "slots_description": "bancs", - "slots": 15, - "listing": false, - "tirage": 2 - }, - "model": "bda.spectacle", - "pk": 14 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 1, - "paid": false - }, - "model": "bda.participant", - "pk": 1 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 1, - "paid": false - }, - "model": "bda.participant", - "pk": 2 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 2, - "paid": false - }, - "model": "bda.participant", - "pk": 3 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 2, - "paid": false - }, - "model": "bda.participant", - "pk": 4 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 3, - "paid": false - }, - "model": "bda.participant", - "pk": 5 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 3, - "paid": false - }, - "model": "bda.participant", - "pk": 6 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 4, - "paid": false - }, - "model": "bda.participant", - "pk": 7 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 4, - "paid": false - }, - "model": "bda.participant", - "pk": 8 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 5, - "paid": false - }, - "model": "bda.participant", - "pk": 9 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 5, - "paid": false - }, - "model": "bda.participant", - "pk": 10 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 6, - "paid": false - }, - "model": "bda.participant", - "pk": 11 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 6, - "paid": false - }, - "model": "bda.participant", - "pk": 12 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 7, - "paid": false - }, - "model": "bda.participant", - "pk": 13 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 7, - "paid": false - }, - "model": "bda.participant", - "pk": 14 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 8, - "paid": false - }, - "model": "bda.participant", - "pk": 15 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 8, - "paid": false - }, - "model": "bda.participant", - "pk": 16 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 9, - "paid": false - }, - "model": "bda.participant", - "pk": 17 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 9, - "paid": false - }, - "model": "bda.participant", - "pk": 18 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 10, - "paid": false - }, - "model": "bda.participant", - "pk": 19 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 10, - "paid": false - }, - "model": "bda.participant", - "pk": 20 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 11, - "paid": false - }, - "model": "bda.participant", - "pk": 21 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 11, - "paid": false - }, - "model": "bda.participant", - "pk": 22 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 12, - "paid": false - }, - "model": "bda.participant", - "pk": 23 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 12, - "paid": false - }, - "model": "bda.participant", - "pk": 24 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 13, - "paid": false - }, - "model": "bda.participant", - "pk": 25 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 13, - "paid": false - }, - "model": "bda.participant", - "pk": 26 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 14, - "paid": false - }, - "model": "bda.participant", - "pk": 27 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 14, - "paid": false - }, - "model": "bda.participant", - "pk": 28 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 15, - "paid": false - }, - "model": "bda.participant", - "pk": 29 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 15, - "paid": false - }, - "model": "bda.participant", - "pk": 30 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 16, - "paid": false - }, - "model": "bda.participant", - "pk": 31 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 16, - "paid": false - }, - "model": "bda.participant", - "pk": 32 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 17, - "paid": false - }, - "model": "bda.participant", - "pk": 33 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 17, - "paid": false - }, - "model": "bda.participant", - "pk": 34 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 18, - "paid": false - }, - "model": "bda.participant", - "pk": 35 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 18, - "paid": false - }, - "model": "bda.participant", - "pk": 36 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 19, - "paid": false - }, - "model": "bda.participant", - "pk": 37 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 19, - "paid": false - }, - "model": "bda.participant", - "pk": 38 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 20, - "paid": false - }, - "model": "bda.participant", - "pk": 39 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 20, - "paid": false - }, - "model": "bda.participant", - "pk": 40 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 21, - "paid": false - }, - "model": "bda.participant", - "pk": 41 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 21, - "paid": false - }, - "model": "bda.participant", - "pk": 42 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 22, - "paid": false - }, - "model": "bda.participant", - "pk": 43 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 22, - "paid": false - }, - "model": "bda.participant", - "pk": 44 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 23, - "paid": false - }, - "model": "bda.participant", - "pk": 45 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 23, - "paid": false - }, - "model": "bda.participant", - "pk": 46 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 24, - "paid": false - }, - "model": "bda.participant", - "pk": 47 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 24, - "paid": false - }, - "model": "bda.participant", - "pk": 48 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 25, - "paid": false - }, - "model": "bda.participant", - "pk": 49 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 25, - "paid": false - }, - "model": "bda.participant", - "pk": 50 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 26, - "paid": false - }, - "model": "bda.participant", - "pk": 51 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 26, - "paid": false - }, - "model": "bda.participant", - "pk": 52 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 27, - "paid": false - }, - "model": "bda.participant", - "pk": 53 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 27, - "paid": false - }, - "model": "bda.participant", - "pk": 54 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 28, - "paid": false - }, - "model": "bda.participant", - "pk": 55 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 28, - "paid": false - }, - "model": "bda.participant", - "pk": 56 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 29, - "paid": false - }, - "model": "bda.participant", - "pk": 57 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 29, - "paid": false - }, - "model": "bda.participant", - "pk": 58 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 30, - "paid": false - }, - "model": "bda.participant", - "pk": 59 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 30, - "paid": false - }, - "model": "bda.participant", - "pk": 60 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 31, - "paid": false - }, - "model": "bda.participant", - "pk": 61 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 31, - "paid": false - }, - "model": "bda.participant", - "pk": 62 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 32, - "paid": false - }, - "model": "bda.participant", - "pk": 63 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 32, - "paid": false - }, - "model": "bda.participant", - "pk": 64 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 33, - "paid": false - }, - "model": "bda.participant", - "pk": 65 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 33, - "paid": false - }, - "model": "bda.participant", - "pk": 66 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 34, - "paid": false - }, - "model": "bda.participant", - "pk": 67 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 34, - "paid": false - }, - "model": "bda.participant", - "pk": 68 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 35, - "paid": false - }, - "model": "bda.participant", - "pk": 69 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 35, - "paid": false - }, - "model": "bda.participant", - "pk": 70 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 36, - "paid": false - }, - "model": "bda.participant", - "pk": 71 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 36, - "paid": false - }, - "model": "bda.participant", - "pk": 72 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 37, - "paid": false - }, - "model": "bda.participant", - "pk": 73 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 37, - "paid": false - }, - "model": "bda.participant", - "pk": 74 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 38, - "paid": false - }, - "model": "bda.participant", - "pk": 75 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 38, - "paid": false - }, - "model": "bda.participant", - "pk": 76 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 39, - "paid": false - }, - "model": "bda.participant", - "pk": 77 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 39, - "paid": false - }, - "model": "bda.participant", - "pk": 78 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 40, - "paid": false - }, - "model": "bda.participant", - "pk": 79 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 40, - "paid": false - }, - "model": "bda.participant", - "pk": 80 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 41, - "paid": false - }, - "model": "bda.participant", - "pk": 81 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 41, - "paid": false - }, - "model": "bda.participant", - "pk": 82 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 42, - "paid": false - }, - "model": "bda.participant", - "pk": 83 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 42, - "paid": false - }, - "model": "bda.participant", - "pk": 84 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 43, - "paid": false - }, - "model": "bda.participant", - "pk": 85 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 43, - "paid": false - }, - "model": "bda.participant", - "pk": 86 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 44, - "paid": false - }, - "model": "bda.participant", - "pk": 87 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 44, - "paid": false - }, - "model": "bda.participant", - "pk": 88 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 45, - "paid": false - }, - "model": "bda.participant", - "pk": 89 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 45, - "paid": false - }, - "model": "bda.participant", - "pk": 90 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 46, - "paid": false - }, - "model": "bda.participant", - "pk": 91 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 46, - "paid": false - }, - "model": "bda.participant", - "pk": 92 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 47, - "paid": false - }, - "model": "bda.participant", - "pk": 93 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 47, - "paid": false - }, - "model": "bda.participant", - "pk": 94 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 48, - "paid": false - }, - "model": "bda.participant", - "pk": 95 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 48, - "paid": false - }, - "model": "bda.participant", - "pk": 96 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 49, - "paid": false - }, - "model": "bda.participant", - "pk": 97 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 49, - "paid": false - }, - "model": "bda.participant", - "pk": 98 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 50, - "paid": false - }, - "model": "bda.participant", - "pk": 99 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 50, - "paid": false - }, - "model": "bda.participant", - "pk": 100 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 51, - "paid": false - }, - "model": "bda.participant", - "pk": 101 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 51, - "paid": false - }, - "model": "bda.participant", - "pk": 102 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 52, - "paid": false - }, - "model": "bda.participant", - "pk": 103 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 52, - "paid": false - }, - "model": "bda.participant", - "pk": 104 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 53, - "paid": false - }, - "model": "bda.participant", - "pk": 105 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 53, - "paid": false - }, - "model": "bda.participant", - "pk": 106 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 54, - "paid": false - }, - "model": "bda.participant", - "pk": 107 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 54, - "paid": false - }, - "model": "bda.participant", - "pk": 108 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 55, - "paid": false - }, - "model": "bda.participant", - "pk": 109 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 55, - "paid": false - }, - "model": "bda.participant", - "pk": 110 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 56, - "paid": false - }, - "model": "bda.participant", - "pk": 111 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 56, - "paid": false - }, - "model": "bda.participant", - "pk": 112 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 57, - "paid": false - }, - "model": "bda.participant", - "pk": 113 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 57, - "paid": false - }, - "model": "bda.participant", - "pk": 114 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 58, - "paid": false - }, - "model": "bda.participant", - "pk": 115 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 58, - "paid": false - }, - "model": "bda.participant", - "pk": 116 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 59, - "paid": false - }, - "model": "bda.participant", - "pk": 117 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 59, - "paid": false - }, - "model": "bda.participant", - "pk": 118 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 60, - "paid": false - }, - "model": "bda.participant", - "pk": 119 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 60, - "paid": false - }, - "model": "bda.participant", - "pk": 120 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 1, - "user": 61, - "paid": false - }, - "model": "bda.participant", - "pk": 121 -}, -{ - "fields": { - "paymenttype": "", - "tirage": 2, - "user": 61, - "paid": false - }, - "model": "bda.participant", - "pk": 122 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 1, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 1 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 1, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 2 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 1, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 3 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 1, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 4 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 1, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 5 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 2, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 6 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 2, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 7 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 2, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 8 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 2, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 9 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 2, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 10 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 3, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 11 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 3, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 12 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 3, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 13 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 3, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 14 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 3, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 15 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 4, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 16 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 4, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 17 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 4, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 18 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 4, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 19 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 4, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 20 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 5, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 21 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 5, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 22 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 5, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 23 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 5, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 24 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 5, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 25 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 6, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 26 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 6, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 27 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 6, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 28 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 6, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 29 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 6, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 30 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 7, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 31 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 7, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 32 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 7, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 33 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 7, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 34 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 7, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 35 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 8, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 36 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 8, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 37 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 8, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 38 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 8, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 39 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 8, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 40 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 9, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 41 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 9, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 42 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 9, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 43 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 9, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 44 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 9, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 45 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 10, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 46 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 10, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 47 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 10, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 48 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 10, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 49 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 10, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 50 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 11, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 51 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 11, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 52 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 11, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 53 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 11, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 54 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 11, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 55 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 12, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 56 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 12, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 57 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 12, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 58 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 12, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 59 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 12, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 60 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 13, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 61 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 13, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 62 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 13, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 63 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 13, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 64 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 13, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 65 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 14, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 66 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 14, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 67 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 14, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 68 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 14, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 69 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 14, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 70 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 15, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 71 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 15, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 72 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 15, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 73 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 15, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 74 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 15, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 75 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 16, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 76 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 16, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 77 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 16, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 78 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 16, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 79 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 16, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 80 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 17, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 81 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 17, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 82 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 17, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 83 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 17, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 84 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 17, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 85 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 18, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 86 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 18, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 87 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 18, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 88 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 18, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 89 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 18, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 90 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 19, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 91 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 19, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 92 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 19, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 93 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 19, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 94 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 19, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 95 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 20, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 96 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 20, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 97 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 20, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 98 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 20, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 99 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 20, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 100 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 21, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 101 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 21, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 102 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 21, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 103 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 21, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 104 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 21, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 105 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 22, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 106 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 22, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 107 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 22, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 108 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 22, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 109 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 22, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 110 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 23, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 111 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 23, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 112 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 23, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 113 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 23, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 114 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 23, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 115 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 24, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 116 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 24, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 117 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 24, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 118 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 24, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 119 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 24, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 120 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 25, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 121 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 25, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 122 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 25, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 123 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 25, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 124 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 25, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 125 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 26, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 126 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 26, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 127 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 26, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 128 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 26, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 129 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 26, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 130 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 27, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 131 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 27, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 132 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 27, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 133 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 27, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 134 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 27, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 135 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 28, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 136 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 28, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 137 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 28, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 138 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 28, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 139 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 28, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 140 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 29, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 141 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 29, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 142 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 29, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 143 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 29, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 144 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 29, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 145 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 30, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 146 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 30, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 147 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 30, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 148 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 30, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 149 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 30, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 150 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 31, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 151 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 31, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 152 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 31, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 153 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 31, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 154 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 31, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 155 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 32, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 156 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 32, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 157 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 32, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 158 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 32, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 159 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 32, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 160 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 33, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 161 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 33, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 162 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 33, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 163 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 33, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 164 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 33, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 165 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 34, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 166 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 34, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 167 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 34, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 168 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 34, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 169 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 34, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 170 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 35, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 171 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 35, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 172 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 35, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 173 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 35, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 174 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 35, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 175 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 36, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 176 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 36, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 177 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 36, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 178 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 36, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 179 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 36, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 180 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 37, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 181 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 37, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 182 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 37, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 183 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 37, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 184 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 37, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 185 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 38, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 186 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 38, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 187 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 38, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 188 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 38, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 189 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 38, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 190 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 39, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 191 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 39, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 192 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 39, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 193 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 39, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 194 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 39, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 195 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 40, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 196 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 40, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 197 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 40, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 198 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 40, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 199 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 40, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 200 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 41, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 201 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 41, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 202 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 41, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 203 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 41, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 204 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 41, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 205 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 42, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 206 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 42, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 207 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 42, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 208 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 42, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 209 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 42, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 210 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 43, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 211 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 43, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 212 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 43, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 213 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 43, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 214 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 43, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 215 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 44, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 216 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 44, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 217 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 44, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 218 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 44, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 219 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 44, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 220 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 45, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 221 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 45, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 222 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 45, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 223 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 45, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 224 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 45, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 225 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 46, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 226 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 46, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 227 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 46, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 228 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 46, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 229 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 46, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 230 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 47, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 231 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 47, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 232 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 47, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 233 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 47, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 234 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 47, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 235 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 48, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 236 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 48, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 237 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 48, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 238 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 48, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 239 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 48, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 240 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 49, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 241 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 49, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 242 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 49, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 243 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 49, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 244 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 49, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 245 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 50, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 246 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 50, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 247 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 50, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 248 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 50, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 249 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 50, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 250 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 51, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 251 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 51, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 252 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 51, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 253 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 51, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 254 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 51, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 255 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 52, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 256 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 52, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 257 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 52, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 258 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 52, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 259 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 52, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 260 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 53, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 261 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 53, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 262 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 53, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 263 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 53, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 264 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 53, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 265 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 54, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 266 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 54, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 267 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 54, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 268 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 54, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 269 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 54, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 270 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 55, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 271 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 55, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 272 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 55, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 273 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 55, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 274 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 55, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 275 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 56, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 276 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 56, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 277 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 56, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 278 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 56, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 279 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 56, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 280 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 57, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 281 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 57, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 282 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 57, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 283 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 57, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 284 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 57, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 285 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 58, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 286 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 58, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 287 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 58, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 288 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 58, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 289 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 58, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 290 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 59, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 291 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 59, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 292 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 59, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 293 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 59, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 294 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 59, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 295 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 60, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 296 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 60, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 297 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 60, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 298 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 60, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 299 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 60, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 300 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 61, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 301 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 61, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 302 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 61, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 303 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 61, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 304 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 61, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 305 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 62, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 306 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 62, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 307 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 62, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 308 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 62, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 309 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 62, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 310 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 63, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 311 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 63, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 312 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 63, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 313 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 63, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 314 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 63, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 315 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 64, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 316 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 64, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 317 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 64, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 318 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 64, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 319 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 64, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 320 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 65, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 321 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 65, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 322 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 65, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 323 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 65, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 324 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 65, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 325 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 66, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 326 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 66, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 327 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 66, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 328 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 66, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 329 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 66, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 330 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 67, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 331 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 67, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 332 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 67, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 333 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 67, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 334 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 67, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 335 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 68, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 336 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 68, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 337 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 68, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 338 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 68, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 339 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 68, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 340 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 69, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 341 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 69, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 342 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 69, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 343 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 69, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 344 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 69, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 345 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 70, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 346 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 70, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 347 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 70, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 348 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 70, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 349 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 70, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 350 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 71, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 351 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 71, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 352 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 71, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 353 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 71, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 354 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 71, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 355 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 72, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 356 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 72, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 357 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 72, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 358 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 72, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 359 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 72, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 360 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 73, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 361 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 73, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 362 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 73, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 363 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 73, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 364 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 73, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 365 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 74, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 366 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 74, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 367 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 74, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 368 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 74, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 369 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 74, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 370 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 75, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 371 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 75, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 372 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 75, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 373 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 75, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 374 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 75, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 375 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 76, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 376 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 76, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 377 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 76, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 378 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 76, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 379 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 76, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 380 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 77, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 381 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 77, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 382 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 77, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 383 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 77, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 384 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 77, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 385 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 78, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 386 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 78, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 387 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 78, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 388 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 78, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 389 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 78, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 390 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 79, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 391 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 79, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 392 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 79, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 393 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 79, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 394 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 79, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 395 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 80, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 396 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 80, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 397 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 80, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 398 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 80, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 399 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 80, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 400 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 81, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 401 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 81, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 402 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 81, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 403 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 81, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 404 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 81, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 405 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 82, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 406 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 82, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 407 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 82, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 408 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 82, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 409 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 82, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 410 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 83, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 411 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 83, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 412 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 83, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 413 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 83, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 414 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 83, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 415 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 84, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 416 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 84, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 417 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 84, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 418 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 84, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 419 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 84, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 420 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 85, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 421 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 85, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 422 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 85, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 423 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 85, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 424 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 85, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 425 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 86, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 426 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 86, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 427 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 86, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 428 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 86, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 429 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 86, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 430 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 87, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 431 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 87, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 432 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 87, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 433 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 87, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 434 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 87, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 435 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 88, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 436 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 88, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 437 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 88, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 438 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 88, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 439 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 88, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 440 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 89, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 441 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 89, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 442 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 89, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 443 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 89, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 444 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 89, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 445 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 90, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 446 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 90, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 447 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 90, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 448 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 90, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 449 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 90, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 450 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 91, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 451 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 91, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 452 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 91, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 453 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 91, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 454 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 91, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 455 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 92, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 456 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 92, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 457 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 92, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 458 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 92, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 459 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 92, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 460 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 93, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 461 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 93, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 462 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 93, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 463 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 93, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 464 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 93, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 465 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 94, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 466 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 94, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 467 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 94, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 468 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 94, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 469 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 94, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 470 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 95, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 471 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 95, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 472 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 95, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 473 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 95, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 474 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 95, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 475 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 96, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 476 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 96, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 477 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 96, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 478 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 96, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 479 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 96, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 480 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 97, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 481 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 97, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 482 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 97, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 483 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 97, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 484 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 97, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 485 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 98, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 486 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 98, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 487 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 98, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 488 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 98, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 489 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 98, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 490 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 99, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 491 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 99, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 492 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 99, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 493 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 99, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 494 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 99, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 495 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 100, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 496 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 100, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 497 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 100, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 498 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 100, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 499 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 100, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 500 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 101, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 501 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 101, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 502 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 101, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 503 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 101, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 504 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 101, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 505 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 102, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 506 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 102, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 507 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 102, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 508 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 102, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 509 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 102, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 510 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 103, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 511 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 103, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 512 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 103, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 513 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 103, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 514 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 103, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 515 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 104, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 516 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 104, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 517 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 104, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 518 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 104, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 519 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 104, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 520 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 105, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 521 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 105, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 522 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 105, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 523 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 105, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 524 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 105, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 525 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 106, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 526 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 106, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 527 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 106, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 528 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 106, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 529 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 106, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 530 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 107, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 531 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 107, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 532 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 107, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 533 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 107, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 534 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 107, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 535 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 108, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 536 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 108, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 537 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 108, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 538 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 108, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 539 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 108, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 540 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 109, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 541 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 109, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 542 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 109, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 543 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 109, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 544 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 109, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 545 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 110, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 546 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 110, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 547 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 110, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 548 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 110, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 549 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 110, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 550 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 111, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 551 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 111, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 552 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 111, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 553 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 111, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 554 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 111, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 555 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 112, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 556 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 112, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 557 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 112, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 558 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 112, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 559 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 112, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 560 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 113, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 561 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 113, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 562 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 113, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 563 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 113, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 564 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 113, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 565 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 114, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 566 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 114, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 567 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 114, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 568 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 114, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 569 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 114, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 570 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 115, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 571 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 115, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 572 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 115, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 573 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 115, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 574 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 115, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 575 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 116, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 576 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 116, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 577 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 116, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 578 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 116, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 579 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 116, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 580 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 117, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 581 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 117, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 582 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 117, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 583 -}, -{ - "fields": { - "priority": 4, - "double_choice": "double", - "participant": 117, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 584 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 117, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 585 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 118, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 586 -}, -{ - "fields": { - "priority": 2, - "double_choice": "double", - "participant": 118, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 587 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 118, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 588 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 118, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 589 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 118, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 590 -}, -{ - "fields": { - "priority": 1, - "double_choice": "1", - "participant": 119, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 591 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 119, - "spectacle": 1 - }, - "model": "bda.choixspectacle", - "pk": 592 -}, -{ - "fields": { - "priority": 3, - "double_choice": "1", - "participant": 119, - "spectacle": 5 - }, - "model": "bda.choixspectacle", - "pk": 593 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 119, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 594 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 119, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 595 -}, -{ - "fields": { - "priority": 1, - "double_choice": "autoquit", - "participant": 120, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 596 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 120, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 597 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 120, - "spectacle": 9 - }, - "model": "bda.choixspectacle", - "pk": 598 -}, -{ - "fields": { - "priority": 4, - "double_choice": "autoquit", - "participant": 120, - "spectacle": 6 - }, - "model": "bda.choixspectacle", - "pk": 599 -}, -{ - "fields": { - "priority": 5, - "double_choice": "1", - "participant": 120, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 600 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 121, - "spectacle": 3 - }, - "model": "bda.choixspectacle", - "pk": 601 -}, -{ - "fields": { - "priority": 2, - "double_choice": "1", - "participant": 121, - "spectacle": 4 - }, - "model": "bda.choixspectacle", - "pk": 602 -}, -{ - "fields": { - "priority": 3, - "double_choice": "double", - "participant": 121, - "spectacle": 2 - }, - "model": "bda.choixspectacle", - "pk": 603 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 121, - "spectacle": 12 - }, - "model": "bda.choixspectacle", - "pk": 604 -}, -{ - "fields": { - "priority": 5, - "double_choice": "double", - "participant": 121, - "spectacle": 10 - }, - "model": "bda.choixspectacle", - "pk": 605 -}, -{ - "fields": { - "priority": 1, - "double_choice": "double", - "participant": 122, - "spectacle": 14 - }, - "model": "bda.choixspectacle", - "pk": 606 -}, -{ - "fields": { - "priority": 2, - "double_choice": "autoquit", - "participant": 122, - "spectacle": 7 - }, - "model": "bda.choixspectacle", - "pk": 607 -}, -{ - "fields": { - "priority": 3, - "double_choice": "autoquit", - "participant": 122, - "spectacle": 13 - }, - "model": "bda.choixspectacle", - "pk": 608 -}, -{ - "fields": { - "priority": 4, - "double_choice": "1", - "participant": 122, - "spectacle": 11 - }, - "model": "bda.choixspectacle", - "pk": 609 -}, -{ - "fields": { - "priority": 5, - "double_choice": "autoquit", - "participant": 122, - "spectacle": 8 - }, - "model": "bda.choixspectacle", - "pk": 610 -} -] diff --git a/bda/forms.py b/bda/forms.py index 352914e4..2029645b 100644 --- a/bda/forms.py +++ b/bda/forms.py @@ -4,11 +4,8 @@ from __future__ import division from __future__ import print_function from __future__ import unicode_literals -from datetime import timedelta - from django import forms from django.forms.models import BaseInlineFormSet -from django.db.models import Q from django.utils import timezone from bda.models import Attribution, Spectacle @@ -46,6 +43,7 @@ class AttributionModelMultipleChoiceField(forms.ModelMultipleChoiceField): class ResellForm(forms.Form): attributions = AttributionModelMultipleChoiceField( + label='', queryset=Attribution.objects.none(), widget=forms.CheckboxSelectMultiple, required=False) @@ -59,6 +57,7 @@ class ResellForm(forms.Form): class AnnulForm(forms.Form): attributions = AttributionModelMultipleChoiceField( + label='', queryset=Attribution.objects.none(), widget=forms.CheckboxSelectMultiple, required=False) @@ -68,7 +67,7 @@ class AnnulForm(forms.Form): self.fields['attributions'].queryset = participant.attribution_set\ .filter(spectacle__date__gte=timezone.now(), revente__isnull=False, - revente__date__gt=timezone.now()-timedelta(hours=1), + revente__notif_sent=False, revente__soldTo__isnull=True) @@ -82,3 +81,19 @@ class InscriptionReventeForm(forms.Form): super(InscriptionReventeForm, self).__init__(*args, **kwargs) self.fields['spectacles'].queryset = tirage.spectacle_set.filter( date__gte=timezone.now()) + + +class SoldForm(forms.Form): + attributions = AttributionModelMultipleChoiceField( + label='', + queryset=Attribution.objects.none(), + widget=forms.CheckboxSelectMultiple) + + def __init__(self, participant, *args, **kwargs): + super(SoldForm, self).__init__(*args, **kwargs) + self.fields['attributions'].queryset = ( + participant.attribution_set + .filter(revente__isnull=False, + revente__soldTo__isnull=False) + .exclude(revente__soldTo=participant) + ) diff --git a/bda/management/commands/loadbdadevdata.py b/bda/management/commands/loadbdadevdata.py new file mode 100644 index 00000000..a8e3f298 --- /dev/null +++ b/bda/management/commands/loadbdadevdata.py @@ -0,0 +1,107 @@ +""" +Crée deux tirages de test et y inscrit les utilisateurs +""" + +import os +import random + +from django.utils import timezone +from django.contrib.auth.models import User + +from gestioncof.management.base import MyBaseCommand +from bda.models import Tirage, Spectacle, Salle, Participant, ChoixSpectacle +from bda.views import do_tirage + + +# Où sont stockés les fichiers json +DATA_DIR = os.path.join(os.path.dirname(os.path.dirname(__file__)), + 'data') + + +class Command(MyBaseCommand): + help = "Crée deux tirages de test et y inscrit les utilisateurs." + + def handle(self, *args, **options): + # --- + # Tirages + # --- + + Tirage.objects.all().delete() + Tirage.objects.bulk_create([ + Tirage( + title="Tirage de test 1", + ouverture=timezone.now()-timezone.timedelta(days=7), + fermeture=timezone.now(), + active=True + ), + Tirage( + title="Tirage de test 2", + ouverture=timezone.now(), + fermeture=timezone.now()+timezone.timedelta(days=60), + active=True + ) + ]) + tirages = Tirage.objects.all() + + # --- + # Salles + # --- + + locations = self.from_json('locations.json', DATA_DIR, Salle) + + # --- + # Spectacles + # --- + + def show_callback(show): + """ + Assigne un tirage, une date et un lieu à un spectacle et décide si + les places sont sur listing. + """ + show.tirage = random.choice(tirages) + show.listing = bool(random.randint(0, 1)) + show.date = ( + show.tirage.fermeture + + timezone.timedelta(days=random.randint(60, 90)) + ) + show.location = random.choice(locations) + return show + shows = self.from_json( + 'shows.json', DATA_DIR, Spectacle, show_callback + ) + + # --- + # Inscriptions + # --- + + self.stdout.write("Inscription des utilisateurs aux tirages") + ChoixSpectacle.objects.all().delete() + choices = [] + for user in User.objects.filter(profile__is_cof=True): + for tirage in tirages: + part, _ = Participant.objects.get_or_create( + user=user, + tirage=tirage + ) + shows = random.sample( + list(tirage.spectacle_set.all()), + tirage.spectacle_set.count() // 2 + ) + for (rank, show) in enumerate(shows): + choices.append(ChoixSpectacle( + participant=part, + spectacle=show, + priority=rank + 1, + double_choice=random.choice( + ['1', 'double', 'autoquit'] + ) + )) + ChoixSpectacle.objects.bulk_create(choices) + self.stdout.write("- {:d} inscriptions générées".format(len(choices))) + + # --- + # On lance le premier tirage + # --- + + self.stdout.write("Lancement du premier tirage") + do_tirage(tirages[0], "dummy_token") diff --git a/bda/management/data/locations.json b/bda/management/data/locations.json new file mode 100644 index 00000000..7208409b --- /dev/null +++ b/bda/management/data/locations.json @@ -0,0 +1,26 @@ +[ +{ + "name": "Cour\u00f4", + "address": "45 rue d'Ulm, cour\u00f4" +}, +{ + "name": "K-F\u00eat", + "address": "45 rue d'Ulm, escalier C, niveau -1" +}, +{ + "name": "Th\u00e9\u00e2tre", + "address": "45 rue d'Ulm, escalier C, niveau -1" +}, +{ + "name": "Cours Pasteur", + "address": "45 rue d'Ulm, cours pasteur" +}, +{ + "name": "Salle des actes", + "address": "45 rue d'Ulm, escalier A, niveau 1" +}, +{ + "name": "Amphi Rataud", + "address": "45 rue d'Ulm, NIR, niveau PB" +} +] diff --git a/bda/management/data/shows.json b/bda/management/data/shows.json new file mode 100644 index 00000000..660f2de9 --- /dev/null +++ b/bda/management/data/shows.json @@ -0,0 +1,100 @@ +[ +{ + "description": "Jazz / Funk", + "title": "Un super concert", + "price": 10.0, + "slots_description": "Debout", + "slots": 5 +}, +{ + "description": "Homemade", + "title": "Une super pi\u00e8ce", + "price": 10.0, + "slots_description": "Assises", + "slots": 60 +}, +{ + "description": "Plein air, soleil, bonne musique", + "title": "Concert pour la f\u00eate de la musique", + "price": 5.0, + "slots_description": "Debout, attention \u00e0 la fontaine", + "slots": 30 +}, +{ + "description": "Sous le regard s\u00e9v\u00e8re de Louis Pasteur", + "title": "Op\u00e9ra sans d\u00e9cors", + "price": 5.0, + "slots_description": "Assis sur l'herbe", + "slots": 20 +}, +{ + "description": "Buffet \u00e0 la fin", + "title": "Concert Trouv\u00e8re", + "price": 20.0, + "slots_description": "Assises", + "slots": 15 +}, +{ + "description": "Vive les maths", + "title": "Dessin \u00e0 la craie sur tableau noir", + "price": 10.0, + "slots_description": "Assises, tablette pour prendre des notes", + "slots": 30 +}, +{ + "description": "Une pi\u00e8ce \u00e0 un personnage", + "title": "D\u00e9cors, d\u00e9montage en musique", + "price": 0.0, + "slots_description": "Assises", + "slots": 20 +}, +{ + "description": "Annulera, annulera pas\u00a0?", + "title": "La Nuit", + "price": 27.0, + "slots_description": "", + "slots": 1000 +}, +{ + "description": "Le boum fait sa carte blanche", + "title": "Turbomix", + "price": 10.0, + "slots_description": "Debout les mains en l'air", + "slots": 20 +}, +{ + "description": "Unique repr\u00e9sentation", + "title": "Carinettes et trombone", + "price": 15.0, + "slots_description": "Chaises ikea", + "slots": 10 +}, +{ + "description": "Suivi d'une jam session", + "title": "Percussion sur rondins", + "price": 5.0, + "slots_description": "B\u00fbches", + "slots": 14 +}, +{ + "description": "\u00c9preuve sportive et artistique", + "title": "Bassin aux ernests, nage libre", + "price": 5.0, + "slots_description": "Humides", + "slots": 10 +}, +{ + "description": "Sonore", + "title": "Chant du barde", + "price": 13.0, + "slots_description": "Ne venez pas", + "slots": 20 +}, +{ + "description": "Cocorico", + "title": "Chant du coq", + "price": 4.0, + "slots_description": "bancs", + "slots": 15 +} +] diff --git a/bda/migrations/0011_tirage_appear_catalogue.py b/bda/migrations/0011_tirage_appear_catalogue.py new file mode 100644 index 00000000..c2a2479d --- /dev/null +++ b/bda/migrations/0011_tirage_appear_catalogue.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('bda', '0010_spectaclerevente_shotgun'), + ] + + operations = [ + migrations.AddField( + model_name='tirage', + name='appear_catalogue', + field=models.BooleanField( + default=False, + verbose_name='Tirage à afficher dans le catalogue' + ), + ), + ] diff --git a/bda/models.py b/bda/models.py index 5b814d3d..15acf686 100644 --- a/bda/models.py +++ b/bda/models.py @@ -1,30 +1,24 @@ # -*- coding: utf-8 -*- -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - import calendar import random from datetime import timedelta +from custommail.shortcuts import send_mass_custom_mail from django.contrib.sites.models import Site from django.db import models from django.contrib.auth.models import User -from django.template import loader -from django.core import mail from django.conf import settings from django.utils import timezone, formats -from django.utils.encoding import python_2_unicode_compatible -@python_2_unicode_compatible class Tirage(models.Model): title = models.CharField("Titre", max_length=300) ouverture = models.DateTimeField("Date et heure d'ouverture du tirage") fermeture = models.DateTimeField("Date et heure de fermerture du tirage") tokens = models.TextField("Graine(s) du tirage", blank=True) active = models.BooleanField("Tirage actif", default=False) + appear_catalogue = models.BooleanField("Tirage à afficher dans le catalogue", default=False) enable_do_tirage = models.BooleanField("Le tirage peut être lancé", default=False) @@ -33,7 +27,6 @@ class Tirage(models.Model): timezone.template_localtime(self.fermeture))) -@python_2_unicode_compatible class Salle(models.Model): name = models.CharField("Nom", max_length=300) address = models.TextField("Adresse") @@ -42,7 +35,6 @@ class Salle(models.Model): return self.name -@python_2_unicode_compatible class CategorieSpectacle(models.Model): name = models.CharField('Nom', max_length=100, unique=True) @@ -53,7 +45,6 @@ class CategorieSpectacle(models.Model): verbose_name = "Catégorie" -@python_2_unicode_compatible class Spectacle(models.Model): title = models.CharField("Titre", max_length=300) category = models.ForeignKey(CategorieSpectacle, blank=True, null=True) @@ -88,6 +79,15 @@ class Spectacle(models.Model): self.price ) + def getImgUrl(self): + """ + Cette fonction permet d'obtenir l'URL de l'image, si elle existe + """ + try: + return self.image.url + except: + return None + def send_rappel(self): """ Envoie un mail de rappel à toutes les personnes qui ont une place pour @@ -100,33 +100,30 @@ class Spectacle(models.Model): if member.id in members: members[member.id][1] = 2 else: - members[member.id] = [member.first_name, 1, member.email] - # Pour le BdA - members[0] = ['BdA', 1, 'bda@ens.fr'] - members[-1] = ['BdA', 2, 'bda@ens.fr'] + members[member.id] = [member, 1] + # FIXME : faire quelque chose de ça, un utilisateur bda_generic ? + # # Pour le BdA + # members[0] = ['BdA', 1, 'bda@ens.fr'] + # members[-1] = ['BdA', 2, 'bda@ens.fr'] # On écrit un mail personnalisé à chaque participant - mails_to_send = [] - mail_object = str(self) - for member in members.values(): - mail_body = loader.render_to_string('bda/mails/rappel.txt', { - 'name': member[0], - 'nb_attr': member[1], - 'show': self}) - mail_tot = mail.EmailMessage( - mail_object, mail_body, - settings.MAIL_DATA['rappels']['FROM'], [member[2]], - [], headers={ - 'Reply-To': settings.MAIL_DATA['rappels']['REPLYTO']}) - mails_to_send.append(mail_tot) - # On envoie les mails - connection = mail.get_connection() - connection.send_messages(mails_to_send) + datatuple = [( + 'bda-rappel', + {'member': member[0], 'nb_attr': member[1], 'show': self}, + settings.MAIL_DATA['rappels']['FROM'], + [member[0].email]) + for member in members.values() + ] + send_mass_custom_mail(datatuple) # On enregistre le fait que l'envoi a bien eu lieu self.rappel_sent = timezone.now() self.save() # On renvoie la liste des destinataires return members.values() + @property + def is_past(self): + return self.date < timezone.now() + class Quote(models.Model): spectacle = models.ForeignKey(Spectacle) @@ -142,7 +139,6 @@ PAYMENT_TYPES = ( ) -@python_2_unicode_compatible class Participant(models.Model): user = models.ForeignKey(User) choices = models.ManyToManyField(Spectacle, @@ -170,7 +166,6 @@ DOUBLE_CHOICES = ( ) -@python_2_unicode_compatible class ChoixSpectacle(models.Model): participant = models.ForeignKey(Participant) spectacle = models.ForeignKey(Spectacle, related_name="participants") @@ -189,7 +184,7 @@ class ChoixSpectacle(models.Model): def __str__(self): return "Vœux de %s pour %s" % ( - self.participant.user.get_full_name, + self.participant.user.get_full_name(), self.spectacle.title) class Meta: @@ -199,7 +194,6 @@ class ChoixSpectacle(models.Model): verbose_name_plural = "voeux" -@python_2_unicode_compatible class Attribution(models.Model): participant = models.ForeignKey(Participant) spectacle = models.ForeignKey(Spectacle, related_name="attribues") @@ -210,7 +204,6 @@ class Attribution(models.Model): self.spectacle.date) -@python_2_unicode_compatible class SpectacleRevente(models.Model): attribution = models.OneToOneField(Attribution, related_name="revente") @@ -251,26 +244,24 @@ class SpectacleRevente(models.Model): verbose_name = "Revente" def send_notif(self): + """ + Envoie une notification pour indiquer la mise en vente d'une place sur + BdA-Revente à tous les intéressés. + """ inscrits = self.attribution.spectacle.subscribed.select_related('user') - - mails_to_send = [] - mail_object = "%s" % (self.attribution.spectacle) - for participant in inscrits: - mail_body = loader.render_to_string('bda/mails/revente.txt', { - 'user': participant.user, - 'spectacle': self.attribution.spectacle, + datatuple = [( + 'bda-revente', + { + 'member': participant.user, + 'show': self.attribution.spectacle, 'revente': self, - 'domain': Site.objects.get_current().domain}) - mail_tot = mail.EmailMessage( - mail_object, mail_body, - settings.MAIL_DATA['revente']['FROM'], - [participant.user.email], - [], headers={ - 'Reply-To': settings.MAIL_DATA['revente']['REPLYTO']}) - mails_to_send.append(mail_tot) - - connection = mail.get_connection() - connection.send_messages(mails_to_send) + 'site': Site.objects.get_current() + }, + settings.MAIL_DATA['revente']['FROM'], + [participant.user.email]) + for participant in inscrits + ] + send_mass_custom_mail(datatuple) self.notif_sent = True self.save() @@ -280,25 +271,18 @@ class SpectacleRevente(models.Model): leur indiquer qu'il est désormais disponible au shotgun. """ inscrits = self.attribution.spectacle.subscribed.select_related('user') - - mails_to_send = [] - mail_object = "%s" % (self.attribution.spectacle) - for participant in inscrits: - mail_body = loader.render_to_string('bda/mails/shotgun.txt', { - 'user': participant.user, - 'spectacle': self.attribution.spectacle, - 'domain': Site.objects.get_current(), - 'mail': self.attribution.participant.user.email}) - mail_tot = mail.EmailMessage( - mail_object, mail_body, - settings.MAIL_DATA['revente']['FROM'], - [participant.user.email], - [], headers={ - 'Reply-To': settings.MAIL_DATA['revente']['REPLYTO']}) - mails_to_send.append(mail_tot) - - connection = mail.get_connection() - connection.send_messages(mails_to_send) + datatuple = [( + 'bda-shotgun', + { + 'member': participant.user, + 'show': self.attribution.spectacle, + 'site': Site.objects.get_current(), + }, + settings.MAIL_DATA['revente']['FROM'], + [participant.user.email]) + for participant in inscrits + ] + send_mass_custom_mail(datatuple) self.notif_sent = True # Flag inutile, sauf si l'horloge interne merde self.tirage_done = True @@ -316,56 +300,42 @@ class SpectacleRevente(models.Model): seller = self.seller if inscrits: - mails = [] - mail_subject = "BdA-Revente : {:s}".format(spectacle.title) - # Envoie un mail au gagnant et au vendeur winner = random.choice(inscrits) self.soldTo = winner + datatuple = [] context = { 'acheteur': winner.user, 'vendeur': seller.user, - 'spectacle': spectacle, + 'show': spectacle, } - mails.append(mail.EmailMessage( - mail_subject, - loader.render_to_string('bda/mails/revente-winner.txt', - context), - from_email=settings.MAIL_DATA['revente']['FROM'], - to=[winner.user.email], - reply_to=[seller.user.email], + datatuple.append(( + 'bda-revente-winner', + context, + settings.MAIL_DATA['revente']['FROM'], + [winner.user.email], )) - mails.append(mail.EmailMessage( - mail_subject, - loader.render_to_string('bda/mails/revente-seller.txt', - context), - from_email=settings.MAIL_DATA['revente']['FROM'], - to=[seller.user.email], - reply_to=[winner.user.email], + datatuple.append(( + 'bda-revente-seller', + context, + settings.MAIL_DATA['revente']['FROM'], + [seller.user.email] )) # Envoie un mail aux perdants for inscrit in inscrits: - if inscrit == winner: - continue - - mail_body = loader.render_to_string( - 'bda/mails/revente-loser.txt', - {'acheteur': inscrit.user, - 'vendeur': seller.user, - 'spectacle': spectacle} - ) - mails.append(mail.EmailMessage( - mail_subject, mail_body, - from_email=settings.MAIL_DATA['revente']['FROM'], - to=[inscrit.user.email], - reply_to=[settings.MAIL_DATA['revente']['REPLYTO']], - )) - mail.get_connection().send_messages(mails) - + if inscrit != winner: + new_context = dict(context) + new_context['acheteur'] = inscrit.user + datatuple.append(( + 'bda-revente-loser', + new_context, + settings.MAIL_DATA['revente']['FROM'], + [inscrit.user.email] + )) + send_mass_custom_mail(datatuple) # Si personne ne veut de la place, elle part au shotgun else: self.shotgun = True - self.tirage_done = True self.save() diff --git a/bda/static/css/bda.css b/bda/static/css/bda.css index d97bb954..4d6ecfbd 100644 --- a/bda/static/css/bda.css +++ b/bda/static/css/bda.css @@ -43,3 +43,6 @@ td { margin: 10px 0px; } +.spectacle-passe { + opacity:0.5; +} diff --git a/bda/templates/bda-participants.html b/bda/templates/bda-participants.html index 3efeccc3..289d1761 100644 --- a/bda/templates/bda-participants.html +++ b/bda/templates/bda-participants.html @@ -47,11 +47,8 @@ {% for participant in participants %}{{participant.name}} : {{participant.nb_places}} places {% endfor %} - - - + - + src="{% static "js/joequery-Stupid-Table-Plugin/stupidtable.js" %}"> + - - - + + + {% endblock %} @@ -94,15 +92,9 @@ var django = {

Inscription au tirage au sort du BdA

- {% if success %} -

Votre inscription a été mise à jour avec succès !

- {% endif %} - {% if stateerror %} -

Impossible d'enregistrer vos modifications: vous avez apporté d'autres modifications entre temps

- {% endif %}
{% csrf_token %} - {% include "inscription-formset.html" %} + {% include "bda/inscription-formset.html" %}
Prix total actuel : {{ total_price }}€
@@ -116,7 +108,7 @@ var django = {

- 1: cette liste de vœu est ordonnée (du plus important au moins important), pour ajuster la priorité vous pouvez déplacer chaque vœu.
+ 1: cette liste de vœux est ordonnée (du plus important au moins important), pour ajuster la priorité vous pouvez déplacer chaque vœu.

diff --git a/bda/templates/liste-reventes.html b/bda/templates/bda/liste-reventes.html similarity index 72% rename from bda/templates/liste-reventes.html rename to bda/templates/bda/liste-reventes.html index c0bf8ff0..fcf57345 100644 --- a/bda/templates/liste-reventes.html +++ b/bda/templates/bda/liste-reventes.html @@ -3,15 +3,6 @@ {% block realcontent %}

Inscriptions pour BdA-Revente

- {% if success %} -

Ton inscription a bien été prise en compte !

- {% endif %} - {% if deja_revente %} -

Des reventes existent déjà pour certains de ces spectacles ; vérifie les places disponibles sans tirage !

- {% elif inscrit_revente %} -

Tu as été inscrit à une revente en cours pour ce spectacle !

- {% endif %} -
{% csrf_token %}
diff --git a/bda/templates/bda/mails-rappel.html b/bda/templates/bda/mails-rappel.html new file mode 100644 index 00000000..73625d1c --- /dev/null +++ b/bda/templates/bda/mails-rappel.html @@ -0,0 +1,43 @@ +{% extends "base_title.html" %} + +{% block realcontent %} +

Mails de rappels

+ {% if sent %} +

Les mails de rappel pour le spectacle {{ show.title }} ont bien été envoyés aux personnes suivantes

+ + {% else %} +

Voulez vous envoyer les mails de rappel pour le spectacle + {{ show.title }} ?

+ {% if show.rappel_sent %} +

Attention, les mails ont déjà été envoyés le + {{ show.rappel_sent }}

+ {% endif %} + {% endif %} + + {% if not sent %} + + {% csrf_token %} +
+ +
+ + {% endif %} + +
+
+

Forme des mails

+ +

Une seule place

+ {% for part in exemple_mail_1place %} +
{{ part }}
+ {% endfor %} + +

Deux places

+ {% for part in exemple_mail_2places %} +
{{ part }}
+ {% endfor %} +{% endblock %} diff --git a/bda/templates/bda/mails/buy-shotgun.txt b/bda/templates/bda/mails/buy-shotgun.txt deleted file mode 100644 index d7855143..00000000 --- a/bda/templates/bda/mails/buy-shotgun.txt +++ /dev/null @@ -1,6 +0,0 @@ -Bonjour {{ vendeur.first_name }} ! - -Je souhaiterais racheter ta place pour {{ spectacle.title }} le {{ spectacle.date }} ({{ spectacle.location }}) à {{ spectacle.price|floatformat:2 }}€. -Contacte-moi si tu es toujours intéressé·e ! - -{{ acheteur.get_full_name }} ({{ acheteur.email }}) diff --git a/bda/templates/bda/mails/rappel.txt b/bda/templates/bda/mails/rappel.txt deleted file mode 100644 index c6433f8a..00000000 --- a/bda/templates/bda/mails/rappel.txt +++ /dev/null @@ -1,23 +0,0 @@ -Bonjour {{ name }}, - -Nous te rappellons que tu as eu la chance d'obtenir {{ nb_attr|pluralize:"une place,deux places" }} -pour {{ show.title }}, le {{ show.date }} au {{ show.location }}. N'oublie pas de t'y rendre ! -{% if nb_attr == 2 %} -Tu as obtenu deux places pour ce spectacle. Nous te rappelons que -ces places sont strictement réservées aux personnes de moins de 28 ans. -{% endif %} -{% if show.listing %}Pour ce spectacle, tu as reçu des places sur -listing. Il te faudra donc te rendre 15 minutes en avance sur les lieux de la représentation -pour retirer {{ nb_attr|pluralize:"ta place,tes places" }}. -{% else %}Pour assister à ce spectacle, tu dois présenter les billets qui ont -été distribués au burô. -{% endif %} - -Si tu ne peux plus assister à cette représentation, tu peux -revendre ta place via BdA-revente, accessible directement sur -GestioCOF (lien "revendre une place du premier tirage" sur la page -d'accueil https://www.cof.ens.fr/gestion/). - -En te souhaitant un excellent spectacle, - -Le Bureau des Arts diff --git a/bda/templates/bda/mails/revente-loser.txt b/bda/templates/bda/mails/revente-loser.txt deleted file mode 100644 index 6b50944d..00000000 --- a/bda/templates/bda/mails/revente-loser.txt +++ /dev/null @@ -1,9 +0,0 @@ -Bonjour {{ acheteur.first_name }}, - -Tu t'étais inscrit-e pour la revente de la place de {{ vendeur.get_full_name }} -pour {{ spectacle.title }}. -Malheureusement, une autre personne a été tirée au sort pour racheter la place. -Tu pourras certainement retenter ta chance pour une autre revente ! - -À très bientôt, -Le Bureau des Arts diff --git a/bda/templates/bda/mails/revente-new.txt b/bda/templates/bda/mails/revente-new.txt deleted file mode 100644 index b4815e84..00000000 --- a/bda/templates/bda/mails/revente-new.txt +++ /dev/null @@ -1,13 +0,0 @@ -Bonjour {{ vendeur.first_name }}, - -Tu t’es bien inscrit-e pour la revente de {{ spectacle.title }}. - -{% with revente.date_tirage as time %} -Le tirage au sort entre tout-e-s les racheteuse-eur-s potentiel-le-s aura lieu -le {{ time|date:"DATE_FORMAT" }} à {{ time|time:"TIME_FORMAT" }} (dans {{time|timeuntil }}). -Si personne ne s’est inscrit pour racheter la place, celle-ci apparaitra parmi -les « Places disponibles immédiatement à la revente » sur GestioCOF. -{% endwith %} - -Bonne revente ! -Le Bureau des Arts diff --git a/bda/templates/bda/mails/revente-seller.txt b/bda/templates/bda/mails/revente-seller.txt deleted file mode 100644 index ec99b98b..00000000 --- a/bda/templates/bda/mails/revente-seller.txt +++ /dev/null @@ -1,7 +0,0 @@ -Bonjour {{ vendeur.first_name }}, - -La personne tirée au sort pour racheter ta place pour {{ spectacle.title }} est {{ acheteur.get_full_name }}. -Tu peux le/la contacter à l'adresse {{ acheteur.email }}, ou en répondant à ce mail. - -Chaleureusement, -Le BdA diff --git a/bda/templates/bda/mails/revente-winner.txt b/bda/templates/bda/mails/revente-winner.txt deleted file mode 100644 index 01ecfb86..00000000 --- a/bda/templates/bda/mails/revente-winner.txt +++ /dev/null @@ -1,7 +0,0 @@ -Bonjour {{ acheteur.first_name }}, - -Tu as été tiré-e au sort pour racheter une place pour {{ spectacle.title }} le {{ spectacle.date }} ({{ spectacle.location }}) à {{ spectacle.price|floatformat:2 }}€. -Tu peux contacter le/la vendeur-se à l'adresse {{ vendeur.email }}, ou en répondant à ce mail. - -Chaleureusement, -Le BdA diff --git a/bda/templates/bda/mails/revente.txt b/bda/templates/bda/mails/revente.txt deleted file mode 100644 index 7efc02e5..00000000 --- a/bda/templates/bda/mails/revente.txt +++ /dev/null @@ -1,14 +0,0 @@ -Bonjour {{ user.first_name }} - -Une place pour le spectacle {{ spectacle.title }} ({{ spectacle.date }}) -a été postée sur BdA-Revente. - -{% with revente.date_tirage as time %} -Si ce spectacle t'intéresse toujours, merci de nous le signaler en cliquant -sur ce lien : http://{{ domain }}{% url "bda-revente-interested" revente.id %}. -Dans le cas où plusieurs personnes seraient intéressées, nous procèderons à -un tirage au sort le {{ time|date:"DATE_FORMAT" }} à {{ time|time:"TIME_FORMAT" }} (dans {{time|timeuntil}}). -{% endwith %} - -Chaleureusement, -Le BdA diff --git a/bda/templates/bda/mails/shotgun.txt b/bda/templates/bda/mails/shotgun.txt deleted file mode 100644 index 69bc704c..00000000 --- a/bda/templates/bda/mails/shotgun.txt +++ /dev/null @@ -1,11 +0,0 @@ -Bonjour {{ user.first_name }} - -Une place pour le spectacle {{ spectacle.title }} ({{ spectacle.date }}) -a été postée sur BdA-Revente. - -Puisque ce spectacle a lieu dans moins de 24h, il n'y a pas de tirage au sort pour -cette place : elle est disponible immédiatement à l'adresse -http://{{ domain }}{% url "bda-buy-revente" spectacle.id %}, à la disposition de tous. - -Chaleureusement, -Le BdA diff --git a/bda/templates/resume_inscription.html b/bda/templates/bda/resume-inscription-tirage.html similarity index 84% rename from bda/templates/resume_inscription.html rename to bda/templates/bda/resume-inscription-tirage.html index 2e0531ca..0ad7ec0e 100644 --- a/bda/templates/resume_inscription.html +++ b/bda/templates/bda/resume-inscription-tirage.html @@ -1,8 +1,6 @@ {% extends "base_title.html" %} {% block realcontent %} -

{{ error_title }}

-

{{ error_description }}

{% if choices %}

Vos vœux:

    diff --git a/bda/templates/resume_places.html b/bda/templates/bda/resume_places.html similarity index 83% rename from bda/templates/resume_places.html rename to bda/templates/bda/resume_places.html index 614a1656..3785169b 100644 --- a/bda/templates/resume_places.html +++ b/bda/templates/bda/resume_places.html @@ -2,9 +2,6 @@ {% block realcontent %}

    Places attribuées

    - {% if warning %} -

    Attention, vous avez reçu plusieurs places pour des spectacles différents à la même date !

    - {% endif %} {% if places %} {% for place in places %} diff --git a/bda/templates/bda/reventes.html b/bda/templates/bda/reventes.html new file mode 100644 index 00000000..e61e7c8d --- /dev/null +++ b/bda/templates/bda/reventes.html @@ -0,0 +1,53 @@ +{% extends "base_title.html" %} +{% load bootstrap %} + +{% block realcontent %} + +

    Revente de place

    +{% if resellform.attributions %} +

    Places non revendues

    + + {% csrf_token %} + {{resellform|bootstrap}} +
    + +
    + +{% endif %} +
    +{% if annulform.attributions or overdue %} +

    Places en cours de revente

    + + {% csrf_token %} +
    +
    +
      + {% for attrib in annulform.attributions %} +
    • {{attrib.tag}} {{attrib.choice_label}}
    • + {% endfor %} + {% for attrib in overdue %} +
    • + + {{attrib.spectacle}} +
    • + {% endfor %} + {% if annulform.attributions %} + + {% endif %} + +{% endif %} +
      +{% if soldform.attributions %} +

      Places revendues

      +
      + {% csrf_token %} + {{soldform|bootstrap}} + + + +{% endif %} +{% if not resellform.attributions and not soldform.attributions and not overdue and not annulform.attributions %} +

      Plus de reventes possibles !

      +{% endif %} + +{% endblock %} diff --git a/bda/templates/mails-rappel.html b/bda/templates/mails-rappel.html deleted file mode 100644 index 3fc15fa2..00000000 --- a/bda/templates/mails-rappel.html +++ /dev/null @@ -1,35 +0,0 @@ -{% extends "base_title.html" %} - -{% block realcontent %} -{% if sent %} -

      Les mails de rappel pour le spectacle {{ show.title }} ont bien été envoyés aux personnes suivantes

      -
        -{% for member in members %} -
      • {{ member.get_full_name }} ({{ member.email }})
      • -{% endfor %} -
      -{% else %} -

      Voulez vous envoyer les mails de rappel pour le spectacle - {{ show.title }} ?

      - {% if show.rappel_sent %} -

      Attention, les mails ont déjà été envoyés le - {{ show.rappel_sent }}

      - {% endif %} -{% endif %} - -{% if not sent %} -
      - {% csrf_token %} -
      - - -{% endif %} - -

      Forme des mails

      - -
      Une seule place

      -
      {{ exemple_mail_1place }}
      - -
      Deux places

      -
      {{ exemple_mail_2places }}
      -{% endblock %} diff --git a/bda/templates/spectacle_list.html b/bda/templates/spectacle_list.html index c7456f6e..d6714335 100644 --- a/bda/templates/spectacle_list.html +++ b/bda/templates/spectacle_list.html @@ -1,6 +1,10 @@ {% extends "base_title.html" %} {% load staticfiles %} +{% block extra_head %} + +{% endblock %} + {% block realcontent %}

      {{tirage_name}}

      Liste des spectacles

      @@ -17,9 +21,9 @@
    {% for spectacle in object_list %} - + - +
    {{ spectacle.title }} {{ spectacle.date }}{{ spectacle.date }} {{ spectacle.location }} {{ spectacle.price |floatformat }}€ @@ -28,10 +32,9 @@ {% endfor %}
    - - + + {% block extra_head %}{% endblock %} diff --git a/gestioncof/templates/base_title.html b/gestioncof/templates/base_title.html index c52f29bb..2e9687dd 100644 --- a/gestioncof/templates/base_title.html +++ b/gestioncof/templates/base_title.html @@ -1,4 +1,4 @@ -{% extends "base_header.html" %} +{% extends "gestioncof/base_header.html" %} {% block interm_content %} diff --git a/gestioncof/templates/demande-petit-cours-raw.html b/gestioncof/templates/demande-petit-cours-raw.html index c2fcf85a..f9bafd8e 100644 --- a/gestioncof/templates/demande-petit-cours-raw.html +++ b/gestioncof/templates/demande-petit-cours-raw.html @@ -1,11 +1,19 @@ +{% extends "base.html" %} + +{% load bootstrap %} + +{% block content %} +
    {% if success %}

    Votre demande a été enregistrée avec succès !

    {% else %}
    {% csrf_token %} - {{ form.as_table }} + {{ form | bootstrap }}
    {% endif %} +
    +{% endblock %} diff --git a/gestioncof/templates/base_header.html b/gestioncof/templates/gestioncof/base_header.html similarity index 60% rename from gestioncof/templates/base_header.html rename to gestioncof/templates/gestioncof/base_header.html index baaa24b6..a7e29eb7 100644 --- a/gestioncof/templates/base_header.html +++ b/gestioncof/templates/gestioncof/base_header.html @@ -16,5 +16,21 @@

    {% if user.first_name %}{{ user.first_name }}{% else %}{{ user.username }}{% endif %}, {% if user.profile.is_cof %}au COF{% else %}non-COF{% endif %}

+{% if messages %} + {% for message in messages %} +
+
+
+ + {% if 'safe' in message.tags %} + {{ message|safe }} + {% else %} + {{ message }} + {% endif %} +
+
+
+ {% endfor %} +{% endif %} {% block interm_content %}{% endblock %} {% endblock %} diff --git a/gestioncof/templates/calendar_subscription.html b/gestioncof/templates/gestioncof/calendar_subscription.html similarity index 64% rename from gestioncof/templates/calendar_subscription.html rename to gestioncof/templates/gestioncof/calendar_subscription.html index 5f0bc988..b13cb7f2 100644 --- a/gestioncof/templates/calendar_subscription.html +++ b/gestioncof/templates/gestioncof/calendar_subscription.html @@ -1,17 +1,10 @@ {% extends "base_title.html" %} +{% load bootstrap %} {% block realcontent %}

Calendrier dynamique

-{% if success %} -

Calendrier mis à jour avec succès

-{% endif %} - -{% if error %} -

{{ error }}

-{% endif %} -

Ce formulaire vous permet de définir un calendrier dynamique compatible avec n'importe quel logiciel ou application d'agenda. Vous pouvez choisir de souscrire aux événements du COF et/ou aux spectacles BdA. @@ -36,8 +29,21 @@ souscrire aux événements du COF et/ou aux spectacles BdA.

{% csrf_token %} -{{ form.as_p }} - +{{ form | bootstrap }} +

+ + +

+ +
+ {% endblock %} diff --git a/gestioncof/templates/details_demande_petit_cours.html b/gestioncof/templates/gestioncof/details_demande_petit_cours.html similarity index 100% rename from gestioncof/templates/details_demande_petit_cours.html rename to gestioncof/templates/gestioncof/details_demande_petit_cours.html diff --git a/gestioncof/templates/event.html b/gestioncof/templates/gestioncof/event.html similarity index 69% rename from gestioncof/templates/event.html rename to gestioncof/templates/gestioncof/event.html index cc7d96d0..52f893db 100644 --- a/gestioncof/templates/event.html +++ b/gestioncof/templates/gestioncof/event.html @@ -2,9 +2,6 @@ {% block realcontent %}

Événement: {{ event.title }}

- {% if success %} -

Votre inscription a bien été enregistrée ! Vous pouvez cependant la modifier jusqu'à la fin des inscriptions.

- {% endif %} {% if event.details %}

{{ event.details }}

{% endif %} diff --git a/gestioncof/templates/profile.html b/gestioncof/templates/gestioncof/profile.html similarity index 89% rename from gestioncof/templates/profile.html rename to gestioncof/templates/gestioncof/profile.html index 7b185150..59358239 100644 --- a/gestioncof/templates/profile.html +++ b/gestioncof/templates/gestioncof/profile.html @@ -5,9 +5,6 @@ {% block realcontent %}

Modifier mon profil

- {% if success %} -

Votre profil a été mis à jour avec succès !

- {% endif %}
{% csrf_token %} diff --git a/gestioncof/templates/registration_form.html b/gestioncof/templates/gestioncof/registration_form.html similarity index 100% rename from gestioncof/templates/registration_form.html rename to gestioncof/templates/gestioncof/registration_form.html diff --git a/gestioncof/templates/gestioncof/registration_post.html b/gestioncof/templates/gestioncof/registration_post.html new file mode 100644 index 00000000..5eca28c9 --- /dev/null +++ b/gestioncof/templates/gestioncof/registration_post.html @@ -0,0 +1,8 @@ +{% extends "base_title.html" %} + +{% block realcontent %} +

Inscription d'un nouveau membre

+
+ {% include "gestioncof/registration_form.html" %} +
+{% endblock %} diff --git a/gestioncof/templates/survey.html b/gestioncof/templates/gestioncof/survey.html similarity index 69% rename from gestioncof/templates/survey.html rename to gestioncof/templates/gestioncof/survey.html index 4d836545..ccf447ef 100644 --- a/gestioncof/templates/survey.html +++ b/gestioncof/templates/gestioncof/survey.html @@ -5,13 +5,6 @@ {% block realcontent %}

Sondage: {{ survey.title }}

- {% if success %} - {% if deleted %} -

Votre réponse a bien été supprimée !

- {% else %} -

Votre réponse a bien été enregistrée ! Vous pouvez cependant la modifier jusqu'à la fin du sondage.

- {% endif %} - {% endif %} {% if survey.details %}

{{ survey.details }}

{% endif %} diff --git a/gestioncof/templates/traitement_demande_petit_cours.html b/gestioncof/templates/gestioncof/traitement_demande_petit_cours.html similarity index 84% rename from gestioncof/templates/traitement_demande_petit_cours.html rename to gestioncof/templates/gestioncof/traitement_demande_petit_cours.html index d51f87b5..4be36a13 100644 --- a/gestioncof/templates/traitement_demande_petit_cours.html +++ b/gestioncof/templates/gestioncof/traitement_demande_petit_cours.html @@ -30,10 +30,16 @@

Mails pour les membres proposés :

{% for proposeduser, mail in proposed_mails %}
Pour {{ proposeduser }}:
-
{{ mail }}
+ {% with object=mail.0 content=mail.1 %} +
{{ object }}
+
{{ content }}
+ {% endwith %} {% endfor %}

Mail pour l'auteur de la demande :

-
{{ mainmail|safe }}
+ {% with object=mainmail.0 content=mainmail.1 %} +
{{ object }}
+
{{ content|safe }}
+ {% endwith %} {% if redo %}{% endif %} diff --git a/gestioncof/templates/traitement_demande_petit_cours_autre_niveau.html b/gestioncof/templates/gestioncof/traitement_demande_petit_cours_autre_niveau.html similarity index 96% rename from gestioncof/templates/traitement_demande_petit_cours_autre_niveau.html rename to gestioncof/templates/gestioncof/traitement_demande_petit_cours_autre_niveau.html index f92be513..c2c7e734 100644 --- a/gestioncof/templates/traitement_demande_petit_cours_autre_niveau.html +++ b/gestioncof/templates/gestioncof/traitement_demande_petit_cours_autre_niveau.html @@ -16,7 +16,6 @@
{% endif %} - {% if proposals %} {% csrf_token %} diff --git a/gestioncof/templates/traitement_demande_petit_cours_success.html b/gestioncof/templates/gestioncof/traitement_demande_petit_cours_success.html similarity index 100% rename from gestioncof/templates/traitement_demande_petit_cours_success.html rename to gestioncof/templates/gestioncof/traitement_demande_petit_cours_success.html diff --git a/gestioncof/templates/utile_cof.html b/gestioncof/templates/gestioncof/utile_cof.html similarity index 79% rename from gestioncof/templates/utile_cof.html rename to gestioncof/templates/gestioncof/utile_cof.html index 51180390..ae024949 100644 --- a/gestioncof/templates/utile_cof.html +++ b/gestioncof/templates/gestioncof/utile_cof.html @@ -17,4 +17,8 @@
  • Export des orgas uniquement
  • Export de tout le monde
  • + +

    Note : pour ouvrir les fichiers .csv avec Excel, il faut + passer par Fichier > Importer et sélectionner la + virgule comme séparateur.

    {% endblock %} diff --git a/gestioncof/templates/home.html b/gestioncof/templates/home.html index c85cbbe1..5f783a48 100644 --- a/gestioncof/templates/home.html +++ b/gestioncof/templates/home.html @@ -1,4 +1,4 @@ -{% extends "base_header.html" %} +{% extends "gestioncof/base_header.html" %} {% block homelink %} {% endblock %} @@ -50,7 +50,20 @@ {% endfor %} {% endif %} + {% endif %} + +

    K-Fêt

    +
    + +
    + {% if user.profile.is_cof %}

    Divers

      diff --git a/gestioncof/templates/inscription-petit-cours.html b/gestioncof/templates/inscription-petit-cours.html index 97182760..4ac0a874 100644 --- a/gestioncof/templates/inscription-petit-cours.html +++ b/gestioncof/templates/inscription-petit-cours.html @@ -2,11 +2,10 @@ {% load staticfiles %} {% block extra_head %} - - - - - + + + + {% endblock %} {% block realcontent %} diff --git a/gestioncof/templates/petits-cours-mail-demandeur.txt b/gestioncof/templates/petits-cours-mail-demandeur.txt deleted file mode 100644 index 8c20834e..00000000 --- a/gestioncof/templates/petits-cours-mail-demandeur.txt +++ /dev/null @@ -1,17 +0,0 @@ -Bonjour, - -Je vous contacte au sujet de votre annonce passée sur le site du COF pour rentrer en contact avec un élève normalien pour des cours particuliers. Voici les coordonnées d'élèves qui sont motivés par de tels cours et correspondent aux critères que vous nous aviez transmis : - -{% for matiere, proposed in proposals %}¤ {{ matiere }} :{% for user in proposed %} - ¤ {{ user.get_full_name }}{% if user.profile.phone %}, {{ user.profile.phone }}{% endif %}{% if user.email %}, {{ user.email }}{% endif %}{% endfor %} - -{% endfor %}{% if unsatisfied %}Nous n'avons cependant pas pu trouver d'élève disponible pour des cours de {% for matiere in unsatisfied %}{% if forloop.counter0 > 0 %}, {% endif %}{{ matiere }}{% endfor %}. - -{% endif %}Si pour une raison ou une autre ces numéros ne suffisaient pas, n'hésitez pas à répondre à cet e-mail et je vous en ferai parvenir d'autres sans problème. -{% if extra|length > 0 %} -{{ extra|safe }} -{% endif %} -Cordialement, - --- -Le COF, BdE de l'ENS diff --git a/gestioncof/templates/petits-cours-mail-eleve.txt b/gestioncof/templates/petits-cours-mail-eleve.txt deleted file mode 100644 index f75fb33f..00000000 --- a/gestioncof/templates/petits-cours-mail-eleve.txt +++ /dev/null @@ -1,28 +0,0 @@ -Salut, - -Le COF a reçu une demande de petit cours qui te correspond. Tu es en haut de la liste d'attente donc on a transmis tes coordonnées, ainsi que celles de 2 autres qui correspondaient aussi (c'est la vie, on donne les numéros 3 par 3 pour que ce soit plus souple). Voici quelques infos sur l'annonce en question : - -¤ Nom : {{ demande.name }} - -¤ Période : {{ demande.quand }} - -¤ Fréquence : {{ demande.freq }} - -¤ Lieu (si préféré) : {{ demande.lieu }} - -¤ Niveau : {{ demande.get_niveau_display }} - -¤ Remarques diverses (désolé pour les balises HTML) : {{ demande.remarques }} - -{% if matieres|length > 1 %}¤ Matières : -{% for matiere in matieres %} ¤ {{ matiere }} -{% endfor %}{% else %}¤ Matière : {% for matiere in matieres %}{{ matiere }} -{% endfor %}{% endif %} -Voilà, cette personne te contactera peut-être sous peu, tu pourras voir les détails directement avec elle (prix, modalités, ...). Pour indication, 30 Euro/h semble être la moyenne. - -Si tu te rends compte qu'en fait tu ne peux pas/plus donner de cours en ce moment, ça serait cool que tu décoches la case "Recevoir des propositions de petits cours" sur GestioCOF. Ensuite dès que tu voudras réapparaître tu pourras recocher la case et tu seras à nouveau sur la liste. - -À bientôt, - --- -Le COF, pour les petits cours diff --git a/gestioncof/templates/registration.html b/gestioncof/templates/registration.html index 4f15a4b7..8f05dfb0 100644 --- a/gestioncof/templates/registration.html +++ b/gestioncof/templates/registration.html @@ -4,13 +4,14 @@ {% block page_size %}col-sm-8{% endblock %} {% block extra_head %} - {% endblock %} {% block realcontent %}

      Inscription d'un nouveau membre

      - +

      Les mots contenant des caractères non alphanumériques seront ignorés

      +
      +{% if account.user == request.user %} + + + +{% endif %} {% endblock %} {% block title %} @@ -51,6 +63,27 @@
    {% endif %} + {% if account.user == request.user %} +
    +

    Statistiques

    +
    +
    +
    +

    Ma balance

    +
    +
    +
    +
    +
    +
    +
    +

    Ma consommation

    +
    +
    +
    +
    +
    + {% endif %}

    Historique

    diff --git a/kfet/templates/kfet/article.html b/kfet/templates/kfet/article.html index 1d0a86fd..17c831df 100644 --- a/kfet/templates/kfet/article.html +++ b/kfet/templates/kfet/article.html @@ -33,6 +33,7 @@ Prix Stock En vente + Affiché Dernier inventaire @@ -40,7 +41,7 @@ {% for article in articles %} {% ifchanged article.category %} - {{ article.category.name }} + {{ article.category.name }} {% endifchanged %} @@ -52,7 +53,8 @@ {{ article.name }} {{ article.price }}€ {{ article.stock }} - {{ article.is_sold }} + {{ article.is_sold | yesno:"En vente,Non vendu"}} + {{ article.hidden | yesno:"Caché,Affiché" }} {{ article.inventory.0.at }} {% endfor %} diff --git a/kfet/templates/kfet/article_create.html b/kfet/templates/kfet/article_create.html index 742756b2..71672f8c 100644 --- a/kfet/templates/kfet/article_create.html +++ b/kfet/templates/kfet/article_create.html @@ -1,17 +1,27 @@ {% extends 'kfet/base.html' %} +{% load widget_tweaks %} +{% load staticfiles %} {% block title %}Nouvel article{% endblock %} {% block content-header-title %}Création d'un article{% endblock %} {% block content %} - - {% csrf_token %} - {{ form.as_p }} - {% if not perms.kfet.add_article %} - - {% endif %} - - +{% include "kfet/base_messages.html" %} + +
    +
    +
    +
    + {% csrf_token %} + {% include 'kfet/form_snippet.html' with form=form %} + {% if not perms.kfet.add_article %} + {% include 'kfet/form_authentication_snippet.html' %} + {% endif %} + {% include 'kfet/form_submit_snippet.html' with value="Enregistrer" %} +
    +
    +
    +
    {% endblock %} diff --git a/kfet/templates/kfet/article_read.html b/kfet/templates/kfet/article_read.html index ea820a09..35b484a5 100644 --- a/kfet/templates/kfet/article_read.html +++ b/kfet/templates/kfet/article_read.html @@ -1,4 +1,5 @@ {% extends 'kfet/base.html' %} +{% load staticfiles %} {% block title %}Informations sur l'article {{ article }}{% endblock %} {% block content-header-title %}Article - {{ article.name }}{% endblock %} @@ -14,7 +15,8 @@
    Prix (hors réduc.): {{ article.price }}€
    Stock: {{ article.stock }}
    -
    En vente: {{ article.is_sold }}
    +
    En vente: {{ article.is_sold | yesno:"Oui,Non" }}
    +
    Affiché: {{ article.hidden | yesno:"Non,Oui" }}
    @@ -76,10 +78,31 @@
    -
    + + +
    +

    Statistiques

    +
    +
    +
    +

    Ventes de {{ article.name }}

    +
    +
    +
    +
    - +{% endblock %} + +{% block extra_head %} + + + {% endblock %} diff --git a/kfet/templates/kfet/article_update.html b/kfet/templates/kfet/article_update.html index db0107cc..85a29f6b 100644 --- a/kfet/templates/kfet/article_update.html +++ b/kfet/templates/kfet/article_update.html @@ -1,17 +1,27 @@ {% extends 'kfet/base.html' %} +{% load widget_tweaks %} +{% load staticfiles %} {% block title %}Édition de l'article {{ article.name }}{% endblock %} {% block content-header-title %}Article {{ article.name }} - Édition{% endblock %} {% block content %} -
    - {% csrf_token %} - {{ form.as_p }} - {% if not perms.kfet.change_article %} - - {% endif %} - -
    +{% include "kfet/base_messages.html" %} + +
    +
    +
    +
    + {% csrf_token %} + {% include 'kfet/form_snippet.html' with form=form %} + {% if not perms.kfet.change_article %} + {% include 'kfet/form_authentication_snippet.html' %} + {% endif %} + {% include 'kfet/form_submit_snippet.html' with value="Mettre à jour" %} +
    +
    +
    +
    {% endblock %} diff --git a/kfet/templates/kfet/checkoutstatement_create.html b/kfet/templates/kfet/checkoutstatement_create.html index 0edb66ad..8ed57017 100644 --- a/kfet/templates/kfet/checkoutstatement_create.html +++ b/kfet/templates/kfet/checkoutstatement_create.html @@ -80,7 +80,7 @@ - Chèque: +

    Chèque:

    diff --git a/kfet/templates/kfet/checkoutstatement_update.html b/kfet/templates/kfet/checkoutstatement_update.html index 18d8938f..fd35b959 100644 --- a/kfet/templates/kfet/checkoutstatement_update.html +++ b/kfet/templates/kfet/checkoutstatement_update.html @@ -15,15 +15,15 @@ Caisse {{ checkout.name }} - Modification relevé {{ checkoutstatement.at }}
    {% include 'kfet/base_messages.html' %} -
    -
    -
    +
    +
    + {% csrf_token %} - {{ form.as_p }} + {% include 'kfet/form_snippet.html' with form=form %} {% if not perms.kfet.change_checkoutstatement %} - + {% include 'kfet/form_authentication_snippet.html' %} {% endif %} - + {% include 'kfet/form_submit_snippet.html' with value="Enregistrer" %}
    diff --git a/kfet/templates/kfet/form_field_snippet.html b/kfet/templates/kfet/form_field_snippet.html index 92ec385d..0873a481 100644 --- a/kfet/templates/kfet/form_field_snippet.html +++ b/kfet/templates/kfet/form_field_snippet.html @@ -4,6 +4,11 @@
    {{ field|add_class:'form-control' }} - {{ field.errors }} + {% if field.errors %} + {{field.errors}} + {% endif %} + {% if field.help_text %} + {{field.help_text}} + {% endif %}
    diff --git a/kfet/templates/kfet/history.html b/kfet/templates/kfet/history.html index 091b4f2f..6d9dfa5c 100644 --- a/kfet/templates/kfet/history.html +++ b/kfet/templates/kfet/history.html @@ -13,8 +13,9 @@ + - + {% endblock %} @@ -60,6 +61,9 @@ {% endblock %} diff --git a/kfet/templates/kfet/order_to_inventory.html b/kfet/templates/kfet/order_to_inventory.html index 4345cf2b..5fe920e9 100644 --- a/kfet/templates/kfet/order_to_inventory.html +++ b/kfet/templates/kfet/order_to_inventory.html @@ -1,4 +1,5 @@ {% extends 'kfet/base.html' %} +{% load widget_tweaks %} {% block title %}{% endblock %} {% block content-header-title %}{% endblock %} @@ -7,34 +8,37 @@ {% include 'kfet/base_messages.html' %} +
    +
    {% csrf_token %} - +
    - - + + - + {% for form in formset %} {% ifchanged form.category %} - - + + + {% endifchanged %} {{ form.article }} - - - + + + - + {% endfor %}
    ArticleHTArticlePrix HT TVA DroitsCom.Commandé Reçu
    {{ form.category_name }}
    {{ form.category_name }}
    {{ form.name }}{{ form.price_HT }}{{ form.TVA }}{{ form.rights }}{{ form.price_HT | add_class:"form-control" }}{{ form.TVA | add_class:"form-control" }}{{ form.rights | add_class:"form-control" }} {{ form.quantity_ordered }}{{ form.quantity_received }}{{ form.quantity_received | add_class:"form-control" }}
    @@ -42,7 +46,9 @@ {% endif %} {{ formset.management_form }} - +
    +
    +
    {% endblock %} diff --git a/kfet/templates/kfet/supplier_form.html b/kfet/templates/kfet/supplier_form.html index d1e10a5c..168f74d9 100644 --- a/kfet/templates/kfet/supplier_form.html +++ b/kfet/templates/kfet/supplier_form.html @@ -1,4 +1,6 @@ {% extends 'kfet/base.html' %} +{% load widget_tweaks %} +{% load staticfiles %} {% block title %}Fournisseur - Modification{% endblock %} {% block content-header-title %}Fournisseur - Modification{% endblock %} @@ -7,13 +9,19 @@ {% include 'kfet/base_messages.html' %} -
    - {% csrf_token %} - {{ form.as_p }} - {% if not perms.kfet.change_supplier %} - - {% endif %} - -
    +
    +
    +
    +
    + {% csrf_token %} + {% include 'kfet/form_snippet.html' with form=form %} + {% if not perms.kfet.change_supplier %} + {% include 'kfet/form_authentication_snippet.html' %} + {% endif %} + {% include 'kfet/form_submit_snippet.html' with value="Mettre à jour" %} +
    +
    +
    +
    {% endblock %} diff --git a/kfet/templatetags/dictionary_extras.py b/kfet/templatetags/dictionary_extras.py new file mode 100644 index 00000000..fafaad8d --- /dev/null +++ b/kfet/templatetags/dictionary_extras.py @@ -0,0 +1,5 @@ +from django.template.defaulttags import register + +@register.filter +def get_item(dictionary, key): + return dictionary.get(key) diff --git a/kfet/templatetags/kfet_tags.py b/kfet/templatetags/kfet_tags.py index 3b1bb639..e21bb778 100644 --- a/kfet/templatetags/kfet_tags.py +++ b/kfet/templatetags/kfet_tags.py @@ -12,12 +12,10 @@ register = template.Library() @register.filter() def highlight_text(text, q): - q2 = "|".join(q.split()) + q2 = "|".join(re.escape(word) for word in q.split()) pattern = re.compile(r"(?P%s)" % q2, re.IGNORECASE) - return mark_safe( - re.sub(pattern, - r"\g", - escape(text))) + regex = r"\g" + return mark_safe(re.sub(pattern, regex, escape(text))) @register.filter(is_safe=True) @@ -29,15 +27,17 @@ def highlight_user(user, q): return highlight_text(text, q) + @register.filter(is_safe=True) def highlight_clipper(clipper, q): if clipper.fullname: - text = "%s (%s)" % (clipper.fullname, clipper.username) + text = "%s (%s)" % (clipper.fullname, clipper.clipper) else: - text = clipper.username + text = clipper.clipper return highlight_text(text, q) + @register.filter() def ukf(balance, is_cof): grant = is_cof and (1 + Settings.SUBVENTION_COF() / 100) or 1 diff --git a/kfet/tests.py b/kfet/tests.py new file mode 100644 index 00000000..5bea7afa --- /dev/null +++ b/kfet/tests.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- + +from django.test import TestCase + +# Écrire les tests ici diff --git a/kfet/urls.py b/kfet/urls.py index e5536509..bec39516 100644 --- a/kfet/urls.py +++ b/kfet/urls.py @@ -7,8 +7,8 @@ from kfet import autocomplete from kfet.decorators import teamkfet_required urlpatterns = [ - url(r'^$', views.home, - name='kfet.home'), + url(r'^$', views.Home.as_view(), + name = 'kfet.home'), url(r'^login/genericteam$', views.login_genericteam, name='kfet.login.genericteam'), url(r'^history$', views.history, @@ -31,7 +31,7 @@ urlpatterns = [ name='kfet.account.create_special'), url(r'^accounts/new/user/(?P.+)$', views.account_create_ajax, name='kfet.account.create.fromuser'), - url(r'^accounts/new/clipper/(?P.+)$', + url(r'^accounts/new/clipper/(?P[\w-]+)/(?P.*)$', views.account_create_ajax, name='kfet.account.create.fromclipper'), url(r'^accounts/new/empty$', views.account_create_ajax, @@ -68,6 +68,30 @@ urlpatterns = [ (views.AccountNegativeList.as_view()), name='kfet.account.negative'), + # Account - Statistics + url('^accounts/(?P.{3})/stat/last/$', + views.AccountStatLastAll.as_view(), + name = 'kfet.account.stat.last'), + url('^accounts/(?P.{3})/stat/last/month/$', + views.AccountStatLastMonth.as_view(), + name = 'kfet.account.stat.last.month'), + url('^accounts/(?P.{3})/stat/last/week/$', + views.AccountStatLastWeek.as_view(), + name = 'kfet.account.stat.last.week'), + url('^accounts/(?P.{3})/stat/last/day/$', + views.AccountStatLastDay.as_view(), + name = 'kfet.account.stat.last.day'), + + url('^accounts/(?P.{3})/stat/balance/$', + views.AccountStatBalanceAll.as_view(), + name = 'kfet.account.stat.balance'), + url('^accounts/(?P.{3})/stat/balance/d/(?P\d*)/$', + views.AccountStatBalance.as_view(), + name = 'kfet.account.stat.balance.days'), + url('^accounts/(?P.{3})/stat/balance/anytime/$', + views.AccountStatBalance.as_view(), + name = 'kfet.account.stat.balance.anytime'), + # ----- # Checkout urls # ----- @@ -125,7 +149,20 @@ urlpatterns = [ # Article - Update url('^articles/(?P\d+)/edit$', teamkfet_required(views.ArticleUpdate.as_view()), - name='kfet.article.update'), + name = 'kfet.article.update'), + # Article - Statistics + url('^articles/(?P\d+)/stat/last/$', + views.ArticleStatLastAll.as_view(), + name = 'kfet.article.stat.last'), + url('^articles/(?P\d+)/stat/last/month/$', + views.ArticleStatLastMonth.as_view(), + name = 'kfet.article.stat.last.month'), + url('^articles/(?P\d+)/stat/last/week/$', + views.ArticleStatLastWeek.as_view(), + name = 'kfet.article.stat.last.week'), + url('^articles/(?P\d+)/stat/last/day/$', + views.ArticleStatLastDay.as_view(), + name = 'kfet.article.stat.last.day'), # ----- # K-Psul urls diff --git a/kfet/views.py b/kfet/views.py index 274ef32a..1941b6e4 100644 --- a/kfet/views.py +++ b/kfet/views.py @@ -1,45 +1,72 @@ # -*- coding: utf-8 -*- -from __future__ import (absolute_import, division, - print_function, unicode_literals) -from builtins import * - from django.shortcuts import render, get_object_or_404, redirect -from django.core.exceptions import PermissionDenied, ValidationError +from django.core.exceptions import PermissionDenied from django.core.cache import cache -from django.views.generic import ListView, DetailView +from django.views.generic import ListView, DetailView, TemplateView +from django.views.generic.list import BaseListView, MultipleObjectTemplateResponseMixin +from django.views.generic.detail import BaseDetailView, SingleObjectTemplateResponseMixin from django.views.generic.edit import CreateView, UpdateView, DeleteView, FormView -from django.core.urlresolvers import reverse_lazy +from django.core.urlresolvers import reverse, reverse_lazy from django.contrib import messages from django.contrib.messages.views import SuccessMessageMixin from django.contrib.auth import authenticate, login from django.contrib.auth.decorators import login_required, permission_required from django.contrib.auth.models import User, Permission, Group -from django.http import HttpResponse, JsonResponse, Http404 -from django.forms import modelformset_factory, formset_factory +from django.http import JsonResponse, Http404 +from django.forms import formset_factory from django.forms.models import model_to_dict -from django.db import IntegrityError, transaction -from django.db.models import F, Sum, Prefetch, Count, Func +from django.db import transaction +from django.db.models import F, Sum, Prefetch, Count from django.db.models.functions import Coalesce from django.utils import timezone from django.utils.crypto import get_random_string -from gestioncof.models import CofProfile, Clipper +from django.utils.decorators import method_decorator +from gestioncof.models import CofProfile from kfet.decorators import teamkfet_required -from kfet.models import (Account, Checkout, Article, Settings, AccountNegative, +from kfet.models import ( + Account, Checkout, Article, Settings, AccountNegative, CheckoutStatement, GenericTeamToken, Supplier, SupplierArticle, Inventory, - InventoryArticle, Order, OrderArticle) -from kfet.forms import * + InventoryArticle, Order, OrderArticle, Operation, OperationGroup, + TransferGroup, Transfer) +from kfet.forms import ( + AccountTriForm, AccountBalanceForm, AccountNoTriForm, UserForm, CofForm, + UserRestrictTeamForm, UserGroupForm, AccountForm, CofRestrictForm, + AccountPwdForm, AccountNegativeForm, UserRestrictForm, AccountRestrictForm, + GroupForm, CheckoutForm, CheckoutRestrictForm, CheckoutStatementCreateForm, + CheckoutStatementUpdateForm, ArticleForm, ArticleRestrictForm, + KPsulOperationGroupForm, KPsulAccountForm, KPsulCheckoutForm, + KPsulOperationFormSet, AddcostForm, FilterHistoryForm, SettingsForm, + TransferFormSet, InventoryArticleForm, OrderArticleForm, + OrderArticleToInventoryForm + ) from collections import defaultdict from kfet import consumers from datetime import timedelta +from decimal import Decimal import django_cas_ng -import hashlib import heapq import statistics +from .statistic import daynames, monthnames, weeknames, \ + lastdays, lastweeks, lastmonths, \ + this_morning, this_monday_morning, this_first_month_day, \ + tot_ventes + +class Home(TemplateView): + template_name = "kfet/home.html" + + def get_context_data(self, **kwargs): + context = super(TemplateView, self).get_context_data(**kwargs) + articles = Article.objects.all().filter(is_sold=True, hidden=False) + context['pressions'] = articles.filter(category__name='Pression') + context['articles'] = (articles.exclude(category__name='Pression') + .order_by('category')) + return context + + @method_decorator(login_required) + def dispatch(self, *args, **kwargs): + return super(TemplateView, self).dispatch(*args, **kwargs) -@login_required -def home(request): - return render(request, "kfet/base.html") @teamkfet_required def login_genericteam(request): @@ -139,8 +166,7 @@ def account_create_special(request): ope = Operation.objects.create( group = opegroup, type = Operation.INITIAL, - amount = amount, - is_checkout = False) + amount = amount) messages.success(request, 'Compte créé : %s' % account.trigramme) return redirect('kfet.account.create') except Account.UserHasAccount as e: @@ -223,19 +249,20 @@ def account_form_set_readonly_fields(user_form, cof_form): cof_form.fields['login_clipper'].widget.attrs['readonly'] = True cof_form.fields['is_cof'].widget.attrs['disabled'] = True -def get_account_create_forms(request=None, username=None, login_clipper=None): +def get_account_create_forms(request=None, username=None, login_clipper=None, + fullname=None): user = None - clipper = None + clipper = False if login_clipper and (login_clipper == username or not username): # à partir d'un clipper # le user associé à ce clipper ne devrait pas encore exister - clipper = get_object_or_404(Clipper, username = login_clipper) + clipper = True try: # Vérification que clipper ne soit pas déjà dans User user = User.objects.get(username=login_clipper) # Ici, on nous a menti, le user existe déjà username = user.username - clipper = None + clipper = False except User.DoesNotExist: # Clipper (sans user déjà existant) @@ -243,9 +270,9 @@ def get_account_create_forms(request=None, username=None, login_clipper=None): user_initial = { 'username' : login_clipper, 'email' : "%s@clipper.ens.fr" % login_clipper} - if clipper.fullname: + if fullname: # Prefill du nom et prénom - names = clipper.fullname.split() + names = fullname.split() # Le premier, c'est le prénom user_initial['first_name'] = names[0] if len(names) > 1: @@ -309,8 +336,11 @@ def get_account_create_forms(request=None, username=None, login_clipper=None): @login_required @teamkfet_required -def account_create_ajax(request, username=None, login_clipper=None): - forms = get_account_create_forms(request=None, username=username, login_clipper=login_clipper) +def account_create_ajax(request, username=None, login_clipper=None, + fullname=None): + forms = get_account_create_forms( + request=None, username=username, login_clipper=login_clipper, + fullname=fullname) return render(request, "kfet/account_create_form.html", { 'account_form' : forms['account_form'], 'cof_form' : forms['cof_form'], @@ -361,6 +391,7 @@ def account_read(request, trigramme): # Account - Update + @login_required def account_update(request, trigramme): account = get_object_or_404(Account, trigramme=trigramme) @@ -371,39 +402,43 @@ def account_update(request, trigramme): raise PermissionDenied if request.user.has_perm('kfet.is_team'): - user_form = UserRestrictTeamForm(instance=account.user) - group_form = UserGroupForm(instance=account.user) + user_form = UserRestrictTeamForm(instance=account.user) + group_form = UserGroupForm(instance=account.user) account_form = AccountForm(instance=account) - cof_form = CofRestrictForm(instance=account.cofprofile) - pwd_form = AccountPwdForm() + cof_form = CofRestrictForm(instance=account.cofprofile) + pwd_form = AccountPwdForm() if account.balance < 0 and not hasattr(account, 'negative'): - AccountNegative.objects.create(account=account, start=timezone.now()) + AccountNegative.objects.create(account=account, + start=timezone.now()) account.refresh_from_db() if hasattr(account, 'negative'): negative_form = AccountNegativeForm(instance=account.negative) else: negative_form = None else: - user_form = UserRestrictForm(instance=account.user) + user_form = UserRestrictForm(instance=account.user) account_form = AccountRestrictForm(instance=account) - cof_form = None - group_form = None + cof_form = None + group_form = None negative_form = None - pwd_form = None + pwd_form = None if request.method == "POST": # Update attempt - success = False + success = False missing_perm = True if request.user.has_perm('kfet.is_team'): account_form = AccountForm(request.POST, instance=account) - cof_form = CofRestrictForm(request.POST, instance=account.cofprofile) - user_form = UserRestrictTeamForm(request.POST, instance=account.user) - group_form = UserGroupForm(request.POST, instance=account.user) - pwd_form = AccountPwdForm(request.POST) + cof_form = CofRestrictForm(request.POST, + instance=account.cofprofile) + user_form = UserRestrictTeamForm(request.POST, + instance=account.user) + group_form = UserGroupForm(request.POST, instance=account.user) + pwd_form = AccountPwdForm(request.POST) if hasattr(account, 'negative'): - negative_form = AccountNegativeForm(request.POST, instance=account.negative) + negative_form = AccountNegativeForm(request.POST, + instance=account.negative) if (request.user.has_perm('kfet.change_account') and account_form.is_valid() and cof_form.is_valid() @@ -415,15 +450,14 @@ def account_update(request, trigramme): put_cleaned_data_in_dict(data, cof_form) # Updating - account_form.save(data = data) + account_form.save(data=data) # Checking perm to update password if (request.user.has_perm('kfet.change_account_password') and pwd_form.is_valid()): pwd = pwd_form.cleaned_data['pwd1'] - pwd_sha256 = hashlib.sha256(pwd.encode('utf-8')).hexdigest() - Account.objects.filter(pk=account.pk).update( - password = pwd_sha256) + account.change_pwd(pwd) + account.save() messages.success(request, 'Mot de passe mis à jour') # Checking perm to manage perms @@ -437,49 +471,66 @@ def account_update(request, trigramme): if account.negative.balance_offset: balance_offset_old = account.negative.balance_offset if (hasattr(account, 'negative') - and request.user.has_perm('kfet.change_accountnegative') + and request.user.has_perm('kfet.change_accountnegative') and negative_form.is_valid()): - balance_offset_new = negative_form.cleaned_data['balance_offset'] + balance_offset_new = \ + negative_form.cleaned_data['balance_offset'] if not balance_offset_new: balance_offset_new = 0 - balance_offset_diff = balance_offset_new - balance_offset_old + balance_offset_diff = (balance_offset_new + - balance_offset_old) Account.objects.filter(pk=account.pk).update( - balance = F('balance') + balance_offset_diff) + balance=F('balance') + balance_offset_diff) negative_form.save() - if not balance_offset_new and Account.objects.get(pk=account.pk).balance >= 0: + if Account.objects.get(pk=account.pk).balance >= 0 \ + and not balance_offset_new: AccountNegative.objects.get(account=account).delete() success = True - messages.success(request, - 'Informations du compte %s mises à jour' % account.trigramme) + messages.success( + request, + 'Informations du compte %s mises à jour' + % account.trigramme) + # Modification de ses propres informations if request.user == account.user: missing_perm = False account.refresh_from_db() user_form = UserRestrictForm(request.POST, instance=account.user) account_form = AccountRestrictForm(request.POST, instance=account) + pwd_form = AccountPwdForm(request.POST) if user_form.is_valid() and account_form.is_valid(): user_form.save() account_form.save() success = True - messages.success(request, 'Vos informations ont été mises à jour') + messages.success(request, + 'Vos informations ont été mises à jour') + + if request.user.has_perm('kfet.is_team') \ + and pwd_form.is_valid(): + pwd = pwd_form.cleaned_data['pwd1'] + account.change_pwd(pwd) + account.save() + messages.success( + request, 'Votre mot de passe a été mis à jour') if missing_perm: messages.error(request, 'Permission refusée') if success: return redirect('kfet.account.read', account.trigramme) else: - messages.error(request, 'Informations non mises à jour. Corrigez les erreurs') + messages.error( + request, 'Informations non mises à jour. Corrigez les erreurs') return render(request, "kfet/account_update.html", { - 'account' : account, - 'account_form' : account_form, - 'cof_form' : cof_form, - 'user_form' : user_form, - 'group_form' : group_form, + 'account': account, + 'account_form': account_form, + 'cof_form': cof_form, + 'user_form': user_form, + 'group_form': group_form, 'negative_form': negative_form, - 'pwd_form' : pwd_form, + 'pwd_form': pwd_form, }) @permission_required('kfet.manage_perms') @@ -811,6 +862,8 @@ class ArticleUpdate(SuccessMessageMixin, UpdateView): # Updating return super(ArticleUpdate, self).form_valid(form) + + # ----- # K-Psul # ----- @@ -956,10 +1009,7 @@ def kpsul_perform_operations(request): operation.amount -= operation.addcost_amount to_addcost_for_balance += operation.addcost_amount if operationgroup.on_acc.is_cash: - operation.is_checkout = True to_checkout_balance += -operation.amount - else: - operation.is_checkout = False if operationgroup.on_acc.is_cof: if is_addcost: operation.addcost_amount = operation.addcost_amount / cof_grant_divisor @@ -967,13 +1017,13 @@ def kpsul_perform_operations(request): to_articles_stocks[operation.article] -= operation.article_nb else: if operationgroup.on_acc.is_cash: - data['errors']['account'] = 'Charge et retrait impossible sur LIQ' - to_checkout_balance += operation.amount + data['errors']['account'] = 'LIQ' + if operation.type != Operation.EDIT: + to_checkout_balance += operation.amount operationgroup.amount += operation.amount if operation.type == Operation.DEPOSIT: required_perms.add('kfet.perform_deposit') - if (not operation.is_checkout - and operation.type in [Operation.DEPOSIT, Operation.WITHDRAW]): + if operation.type == Operation.EDIT: required_perms.add('kfet.edit_balance_account') need_comment = True if operationgroup.on_acc.is_cof: @@ -987,7 +1037,9 @@ def kpsul_perform_operations(request): operationgroup.comment = operationgroup.comment.strip() if not operationgroup.comment: data['errors']['need_comment'] = True - return JsonResponse(data, status=400) + + if data['errors']: + return JsonResponse(data, status=400) if stop or not request.user.has_perms(required_perms): missing_perms = get_missing_perms(required_perms, request.user) @@ -1068,8 +1120,7 @@ def kpsul_perform_operations(request): ope_data = { 'id': operation.pk, 'type': operation.type, 'amount': operation.amount, 'addcost_amount': operation.addcost_amount, - 'addcost_for__trigramme': is_addcost and addcost_for.trigramme or None, - 'is_checkout': operation.is_checkout, + 'addcost_for__trigramme': operation.addcost_for and addcost_for.trigramme or None, 'article__name': operation.article and operation.article.name or None, 'article_nb': operation.article_nb, 'group_id': operationgroup.pk, @@ -1159,11 +1210,11 @@ def kpsul_cancel_operations(request): .order_by('at') .last()) if not last_statement or last_statement.at < ope.group.at: - if ope.type == Operation.PURCHASE: + if ope.is_checkout: if ope.group.on_acc.is_cash: to_checkouts_balances[ope.group.checkout] -= - ope.amount - else: - to_checkouts_balances[ope.group.checkout] -= ope.amount + else: + to_checkouts_balances[ope.group.checkout] -= ope.amount # Pour les stocks d'articles # Les stocks d'articles dont il y a eu un inventaire depuis la date @@ -1324,7 +1375,6 @@ def history_json(request): 'type' : ope.type, 'amount' : ope.amount, 'article_nb' : ope.article_nb, - 'is_checkout' : ope.is_checkout, 'addcost_amount': ope.addcost_amount, 'canceled_at' : ope.canceled_at, 'article__name': @@ -1965,3 +2015,591 @@ class SupplierUpdate(SuccessMessageMixin, UpdateView): return self.form_invalid(form) # Updating return super(SupplierUpdate, self).form_valid(form) + + +# ========== +# Statistics +# ========== + +# --------------- +# Vues génériques +# --------------- +# source : docs.djangoproject.com/fr/1.10/topics/class-based-views/mixins/ +class JSONResponseMixin(object): + """ + A mixin that can be used to render a JSON response. + """ + def render_to_json_response(self, context, **response_kwargs): + """ + Returns a JSON response, transforming 'context' to make the payload. + """ + return JsonResponse( + self.get_data(context), + **response_kwargs + ) + + def get_data(self, context): + """ + Returns an object that will be serialized as JSON by json.dumps(). + """ + # Note: This is *EXTREMELY* naive; in reality, you'll need + # to do much more complex handling to ensure that arbitrary + # objects -- such as Django model instances or querysets + # -- can be serialized as JSON. + return context + + +class JSONDetailView(JSONResponseMixin, + BaseDetailView): + """ + Returns a DetailView that renders a JSON + """ + def render_to_response(self, context): + return self.render_to_json_response(context) + +class HybridDetailView(JSONResponseMixin, + SingleObjectTemplateResponseMixin, + BaseDetailView): + """ + Returns a DetailView as an html page except if a JSON file is requested + by the GET method in which case it returns a JSON response. + """ + def render_to_response(self, context): + # Look for a 'format=json' GET argument + if self.request.GET.get('format') == 'json': + return self.render_to_json_response(context) + else: + return super(HybridDetailView, self).render_to_response(context) + + +class HybridListView(JSONResponseMixin, + MultipleObjectTemplateResponseMixin, + BaseListView): + """ + Returns a ListView as an html page except if a JSON file is requested + by the GET method in which case it returns a JSON response. + """ + def render_to_response(self, context): + # Look for a 'format=json' GET argument + if self.request.GET.get('format') == 'json': + return self.render_to_json_response(context) + else: + return super(HybridListView, self).render_to_response(context) + + +class ObjectResumeStat(JSONDetailView): + """ + Summarize all the stats of an object + Handles JSONResponse + """ + context_object_name = '' + id_prefix = '' + # nombre de vues à résumer + nb_stat = 2 + # Le combienième est celui par defaut ? + # (entre 0 et nb_stat-1) + nb_default = 0 + stat_labels = ['stat_1', 'stat_2'] + stat_urls = ['url_1', 'url_2'] + + # sert à renverser les urls + # utile de le surcharger quand l'url prend d'autres arguments que l'id + def get_object_url_kwargs(self, **kwargs): + return {'pk': self.object.id} + + def url_kwargs(self, **kwargs): + return [{}] * self.nb_stat + + def get_context_data(self, **kwargs): + # On n'hérite pas + object_id = self.object.id + url_kwargs = self.url_kwargs() + context = {} + stats = {} + for i in range(self.nb_stat): + stats[i] = { + 'label': self.stat_labels[i], + 'btn': "btn_%s_%d_%d" % (self.id_prefix, + object_id, + i), + 'url': reverse(self.stat_urls[i], + kwargs=dict( + self.get_object_url_kwargs(), + **url_kwargs[i] + ), + ), + } + prefix = "%s_%d" % (self.id_prefix, object_id) + context['id_prefix'] = prefix + context['content_id'] = "content_%s" % prefix + context['stats'] = stats + context['default_stat'] = self.nb_default + context['object_id'] = object_id + return context + + +# ----------------------- +# Evolution Balance perso +# ----------------------- +ID_PREFIX_ACC_BALANCE = "balance_acc" + + +# Un résumé de toutes les vues ArticleStatBalance +# REND DU JSON +class AccountStatBalanceAll(ObjectResumeStat): + model = Account + context_object_name = 'account' + trigramme_url_kwarg = 'trigramme' + id_prefix = ID_PREFIX_ACC_BALANCE + nb_stat = 5 + nb_default = 0 + stat_labels = ["Tout le temps", "1 an", "6 mois", "3 mois", "30 jours"] + stat_urls = ['kfet.account.stat.balance.anytime'] \ + + ['kfet.account.stat.balance.days'] * 4 + + def get_object(self, **kwargs): + trigramme = self.kwargs.get(self.trigramme_url_kwarg) + return get_object_or_404(Account, trigramme=trigramme) + + def get_object_url_kwargs(self, **kwargs): + return {'trigramme': self.object.trigramme} + + def url_kwargs(self, **kwargs): + context_list = (super(AccountStatBalanceAll, self) + .url_kwargs(**kwargs)) + context_list[1] = {'nb_date': 365} + context_list[2] = {'nb_date': 183} + context_list[3] = {'nb_date': 90} + context_list[4] = {'nb_date': 30} + return context_list + + @method_decorator(login_required) + def dispatch(self, *args, **kwargs): + return super(AccountStatBalanceAll, self).dispatch(*args, **kwargs) + + +class AccountStatBalance(JSONDetailView): + """ + Returns a JSON containing the evolution a the personnal + balance of a trigramme between timezone.now() and `nb_days` + ago (specified to the view as an argument) + takes into account the Operations and the Transfers + does not takes into account the balance offset + """ + model = Account + trigramme_url_kwarg = 'trigramme' + nb_date_url_kwargs = 'nb_date' + context_object_name = 'account' + id_prefix = "" + + def get_object(self, **kwargs): + trigramme = self.kwargs.get(self.trigramme_url_kwarg) + return get_object_or_404(Account, trigramme=trigramme) + + def get_changes_list(self, **kwargs): + account = self.object + nb_date = self.kwargs.get(self.nb_date_url_kwargs, None) + end_date = this_morning() + if nb_date is None: + begin_date = timezone.datetime(year=1980, month=1, day=1) + anytime = True + else: + begin_date = this_morning() \ + - timezone.timedelta(days=int(nb_date)) + anytime = False + # On récupère les opérations + # TODO: retirer les opgroup dont tous les op sont annulées + opgroups = list(OperationGroup.objects + .filter(on_acc=account) + .filter(at__gte=begin_date) + .filter(at__lte=end_date)) + # On récupère les transferts reçus + received_transfers = list(Transfer.objects + .filter(to_acc=account) + .filter(canceled_at=None) + .filter(group__at__gte=begin_date) + .filter(group__at__lte=end_date)) + # On récupère les transferts émis + emitted_transfers = list(Transfer.objects + .filter(from_acc=account) + .filter(canceled_at=None) + .filter(group__at__gte=begin_date) + .filter(group__at__lte=end_date)) + # On transforme tout ça en une liste de dictionnaires sous la forme + # {'at': date, + # 'amount': changement de la balance (négatif si diminue la balance, + # positif si l'augmente), + # 'label': text descriptif, + # 'balance': état de la balance après l'action (0 pour le moment, + # sera mis à jour lors d'une + # autre passe) + # } + actions = [ + # Maintenant (à changer si on gère autre chose que now) + { + 'at': end_date.isoformat(), + 'amout': 0, + 'label': "actuel", + 'balance': 0, + } + ] + [ + { + 'at': op.at.isoformat(), + 'amount': op.amount, + 'label': str(op), + 'balance': 0, + } for op in opgroups + ] + [ + { + 'at': tr.group.at.isoformat(), + 'amount': tr.amount, + 'label': "%d€: %s -> %s" % (tr.amount, + tr.from_acc.trigramme, + tr.to_acc.trigramme), + 'balance': 0, + } for tr in received_transfers + ] + [ + { + 'at': tr.group.at.isoformat(), + 'amount': -tr.amount, + 'label': "%d€: %s -> %s" % (tr.amount, + tr.from_acc.trigramme, + tr.to_acc.trigramme), + 'balance': 0, + } for tr in emitted_transfers + ] + if not anytime: + actions += [ + # Date de début : + { + 'at': begin_date.isoformat(), + 'amount': 0, + 'label': "début", + 'balance': 0, + } + ] + # Maintenant on trie la liste des actions par ordre du plus récent + # an plus ancien et on met à jour la balance + actions = sorted(actions, key=lambda k: k['at'], reverse=True) + actions[0]['balance'] = account.balance + for i in range(len(actions)-1): + actions[i+1]['balance'] = actions[i]['balance'] \ + - actions[i+1]['amount'] + return actions + + def get_context_data(self, **kwargs): + context = {} + changes = self.get_changes_list() + nb_days = self.kwargs.get(self.nb_date_url_kwargs, None) + if nb_days is None: + nb_days_string = 'anytime' + else: + nb_days_string = str(int(nb_days)) + context['charts'] = [ { "color": "rgb(255, 99, 132)", + "label": "Balance", + "values": changes } ] + context['is_time_chart'] = True + context['min_date'] = changes[len(changes)-1]['at'] + context['max_date'] = changes[0]['at'] + # TODO: offset + return context + + @method_decorator(login_required) + def dispatch(self, *args, **kwargs): + return super(AccountStatBalance, self).dispatch(*args, **kwargs) + + +# ------------------------ +# Consommation personnelle +# ------------------------ +ID_PREFIX_ACC_LAST = "last_acc" +ID_PREFIX_ACC_LAST_DAYS = "last_days_acc" +ID_PREFIX_ACC_LAST_WEEKS = "last_weeks_acc" +ID_PREFIX_ACC_LAST_MONTHS = "last_months_acc" + + +# Un résumé de toutes les vues ArticleStatLast +# NE REND PAS DE JSON +class AccountStatLastAll(ObjectResumeStat): + model = Account + context_object_name = 'account' + trigramme_url_kwarg = 'trigramme' + id_prefix = ID_PREFIX_ACC_LAST + nb_stat = 3 + nb_default = 2 + stat_labels = ["Derniers mois", "Dernières semaines", "Derniers jours"] + stat_urls = ['kfet.account.stat.last.month', + 'kfet.account.stat.last.week', + 'kfet.account.stat.last.day'] + + def get_object(self, **kwargs): + trigramme = self.kwargs.get(self.trigramme_url_kwarg) + return get_object_or_404(Account, trigramme=trigramme) + + def get_object_url_kwargs(self, **kwargs): + return {'trigramme': self.object.trigramme} + + @method_decorator(login_required) + def dispatch(self, *args, **kwargs): + return super(AccountStatLastAll, self).dispatch(*args, **kwargs) + + +class AccountStatLast(JSONDetailView): + """ + Returns a JSON containing the evolution a the personnal + consommation of a trigramme at the diffent dates specified + """ + model = Account + trigramme_url_kwarg = 'trigramme' + context_object_name = 'account' + end_date = timezone.now() + id_prefix = "" + + # doit rendre un dictionnaire des dates + # la première date correspond au début + # la dernière date est la fin de la dernière plage + def get_dates(self, **kwargs): + return {} + + # doit rendre un dictionnaire des labels + # le dernier label ne sera pas utilisé + def get_labels(self, **kwargs): + pass + + def get_object(self, **kwargs): + trigramme = self.kwargs.get(self.trigramme_url_kwarg) + return get_object_or_404(Account, trigramme=trigramme) + + def sort_operations(self, **kwargs): + # On récupère les dates + dates = self.get_dates() + # On ajoute la date de fin + extended_dates = dates.copy() + extended_dates[len(dates)+1] = self.end_date + # On selectionne les opérations qui correspondent + # à l'article en question et qui ne sont pas annulées + # puis on choisi pour chaques intervalle les opérations + # effectuées dans ces intervalles de temps + all_operations = (Operation.objects + .filter(type='purchase') + .filter(group__on_acc=self.object) + .filter(canceled_at=None) + ) + operations = {} + for i in dates: + operations[i] = (all_operations + .filter(group__at__gte=extended_dates[i]) + .filter(group__at__lte=extended_dates[i+1]) + ) + return operations + + def get_context_data(self, **kwargs): + context = {} + nb_ventes = {} + # On récupère les labels des dates + context['labels'] = self.get_labels().copy() + # On compte les opérations + operations = self.sort_operations() + for i in operations: + nb_ventes[i] = tot_ventes(operations[i]) + context['charts'] = [ { "color": "rgb(255, 99, 132)", + "label": "NB items achetés", + "values": nb_ventes } ] + return context + + @method_decorator(login_required) + def dispatch(self, *args, **kwargs): + return super(AccountStatLast, self).dispatch(*args, **kwargs) + + +# Rend les achats pour ce compte des 7 derniers jours +# Aujourd'hui non compris +class AccountStatLastDay(AccountStatLast): + end_date = this_morning() + id_prefix = ID_PREFIX_ACC_LAST_DAYS + + def get_dates(self, **kwargs): + return lastdays(7) + + def get_labels(self, **kwargs): + days = lastdays(7) + return daynames(days) + + +# Rend les achats de ce compte des 7 dernières semaines +# La semaine en cours n'est pas comprise +class AccountStatLastWeek(AccountStatLast): + end_date = this_monday_morning() + id_prefix = ID_PREFIX_ACC_LAST_WEEKS + + def get_dates(self, **kwargs): + return lastweeks(7) + + def get_labels(self, **kwargs): + weeks = lastweeks(7) + return weeknames(weeks) + + +# Rend les achats de ce compte des 7 derniers mois +# Le mois en cours n'est pas compris +class AccountStatLastMonth(AccountStatLast): + end_date = this_monday_morning() + id_prefix = ID_PREFIX_ACC_LAST_MONTHS + + def get_dates(self, **kwargs): + return lastmonths(7) + + def get_labels(self, **kwargs): + months = lastmonths(7) + return monthnames(months) + + +# ------------------------ +# Article Satistiques Last +# ------------------------ +ID_PREFIX_ART_LAST = "last_art" +ID_PREFIX_ART_LAST_DAYS = "last_days_art" +ID_PREFIX_ART_LAST_WEEKS = "last_weeks_art" +ID_PREFIX_ART_LAST_MONTHS = "last_months_art" + + +# Un résumé de toutes les vues ArticleStatLast +# NE REND PAS DE JSON +class ArticleStatLastAll(ObjectResumeStat): + model = Article + context_object_name = 'article' + id_prefix = ID_PREFIX_ART_LAST + nb_stat = 3 + nb_default = 2 + stat_labels = ["Derniers mois", "Dernières semaines", "Derniers jours"] + stat_urls = ['kfet.article.stat.last.month', + 'kfet.article.stat.last.week', + 'kfet.article.stat.last.day'] + + @method_decorator(login_required) + def dispatch(self, *args, **kwargs): + return super(ArticleStatLastAll, self).dispatch(*args, **kwargs) + + +class ArticleStatLast(JSONDetailView): + """ + Returns a JSON containing the consommation + of an article at the diffent dates precised + """ + model = Article + context_object_name = 'article' + end_date = timezone.now() + id_prefix = "" + + def render_to_response(self, context): + # Look for a 'format=json' GET argument + if self.request.GET.get('format') == 'json': + return self.render_to_json_response(context) + else: + return super(ArticleStatLast, self).render_to_response(context) + + # doit rendre un dictionnaire des dates + # la première date correspond au début + # la dernière date est la fin de la dernière plage + def get_dates(self, **kwargs): + pass + + # doit rendre un dictionnaire des labels + # le dernier label ne sera pas utilisé + def get_labels(self, **kwargs): + pass + + def get_context_data(self, **kwargs): + context = {} + # On récupère les labels des dates + context['labels'] = self.get_labels().copy() + # On récupère les dates + dates = self.get_dates() + # On ajoute la date de fin + extended_dates = dates.copy() + extended_dates[len(dates)+1] = self.end_date + # On selectionne les opérations qui correspondent + # à l'article en question et qui ne sont pas annulées + # puis on choisi pour chaques intervalle les opérations + # effectuées dans ces intervalles de temps + all_operations = (Operation.objects + .filter(type='purchase') + .filter(article=self.object) + .filter(canceled_at=None) + ) + operations = {} + for i in dates: + operations[i] = (all_operations + .filter(group__at__gte=extended_dates[i]) + .filter(group__at__lte=extended_dates[i+1]) + ) + # On compte les opérations + nb_ventes = {} + nb_accounts = {} + nb_liq = {} + for i in operations: + nb_ventes[i] = tot_ventes(operations[i]) + nb_liq[i] = tot_ventes( + operations[i] + .filter(group__on_acc__trigramme='LIQ') + ) + nb_accounts[i] = tot_ventes( + operations[i] + .exclude(group__on_acc__trigramme='LIQ') + ) + context['charts'] = [ { "color": "rgb(255, 99, 132)", + "label": "Toutes consommations", + "values": nb_ventes }, + { "color": "rgb(54, 162, 235)", + "label": "LIQ", + "values": nb_liq }, + { "color": "rgb(255, 205, 86)", + "label": "Comptes K-Fêt", + "values": nb_accounts } ] + return context + + @method_decorator(login_required) + def dispatch(self, *args, **kwargs): + return super(ArticleStatLast, self).dispatch(*args, **kwargs) + + +# Rend les ventes des 7 derniers jours +# Aujourd'hui non compris +class ArticleStatLastDay(ArticleStatLast): + end_date = this_morning() + id_prefix = ID_PREFIX_ART_LAST_DAYS + + def get_dates(self, **kwargs): + return lastdays(7) + + def get_labels(self, **kwargs): + days = lastdays(7) + return daynames(days) + + +# Rend les ventes de 7 dernières semaines +# La semaine en cours n'est pas comprise +class ArticleStatLastWeek(ArticleStatLast): + end_date = this_monday_morning() + id_prefix = ID_PREFIX_ART_LAST_WEEKS + + def get_dates(self, **kwargs): + return lastweeks(7) + + def get_labels(self, **kwargs): + weeks = lastweeks(7) + return weeknames(weeks) + + +# Rend les ventes des 7 derniers mois +# Le mois en cours n'est pas compris +class ArticleStatLastMonth(ArticleStatLast): + end_date = this_monday_morning() + id_prefix = ID_PREFIX_ART_LAST_MONTHS + + def get_dates(self, **kwargs): + return lastmonths(7) + + def get_labels(self, **kwargs): + months = lastmonths(7) + return monthnames(months) diff --git a/provisioning/bootstrap.sh b/provisioning/bootstrap.sh index 413c445e..269e4f25 100644 --- a/provisioning/bootstrap.sh +++ b/provisioning/bootstrap.sh @@ -21,7 +21,7 @@ echo "mysql-server mysql-server/root_password_again password $DBPASSWD" | debcon apt-get install -y mysql-server mysql -uroot -p$DBPASSWD -e "CREATE DATABASE $DBNAME; GRANT ALL PRIVILEGES ON $DBNAME.* TO '$DBUSER'@'localhost' IDENTIFIED BY '$DBPASSWD'" -mysql -uroot -p$DBPASSWD -e "CREATE DATABASE test_$DBNAME; GRANT ALL PRIVILEGES ON test_$DBNAME.* TO '$DBUSER'@'localhost'" +mysql -uroot -p$DBPASSWD -e "GRANT ALL PRIVILEGES ON test_$DBNAME.* TO '$DBUSER'@'localhost'" # Installation et configuration d'Apache apt-get install -y apache2 diff --git a/provisioning/prepare_django.sh b/provisioning/prepare_django.sh index c8c80d05..4ec1a70f 100644 --- a/provisioning/prepare_django.sh +++ b/provisioning/prepare_django.sh @@ -3,5 +3,7 @@ source ~/venv/bin/activate python manage.py migrate -python manage.py loaddata users root bda gestion sites +python manage.py loaddata gestion sites articles +python manage.py loaddevdata +python manage.py syncmails python manage.py collectstatic --noinput diff --git a/requirements.txt b/requirements.txt index 53132e50..db9f7e4c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,5 +17,7 @@ asgi-redis==0.14.0 statistics==1.0.3.5 future==0.15.2 django-widget-tweaks==1.4.1 +git+https://git.eleves.ens.fr/cof-geek/django_custommail.git#egg=django_custommail +ldap3 git+https://github.com/Aureplop/channels.git#egg=channels django-js-reverse==0.7.3 diff --git a/sync_clipper.py b/sync_clipper.py deleted file mode 100644 index d9620b2d..00000000 --- a/sync_clipper.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - -import os -import sys - -if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cof.settings") - - from gestioncof.models import Clipper - current = {} - print("[ FETCHING ]") - for clipper in Clipper.objects.all(): - current[clipper.username] = clipper - print("[ SYNCING ]") - for line in sys.stdin: - bits = line.split(":") - username = bits[0] - fullname = bits[4] - if username in current: - clipper = current[username] - if clipper.fullname != fullname: - clipper.fullname = fullname - clipper.save() - print("Updated", username) - else: - clipper = Clipper(username=username, fullname=fullname) - clipper.save() - print("Created", username) - print("[ DONE ]") diff --git a/sync_clipper.sh b/sync_clipper.sh deleted file mode 100644 index dc996d30..00000000 --- a/sync_clipper.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -ssh cof@sas.eleves.ens.fr ypcat passwd | python sync_clipper.py