-
Notifications
You must be signed in to change notification settings - Fork 6
Refactor election #1046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: taiste
Are you sure you want to change the base?
Refactor election #1046
Conversation
86353dc to
349e90f
Compare
| * </div> | ||
| * ``` | ||
| */ | ||
| Alpine.directive( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je sais pas trop où, mais il y a un truc qui fait que tous les votes partent en vote blanc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'arrive pas à reproduire. Chez moi ça marche. C'est peut-être le rebase.
| from election.models import Candidature, Election, ElectionList, Role | ||
|
|
||
|
|
||
| class LimitedCheckboxField(forms.ModelMultipleChoiceField): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Il devrait y avoir un widget lié à ce champ de formulaire pour s'assurer que le alpine que t'as fait est utilisé.
Ça permetrait aussi de passer l'id actuel du field directement dans le alpine et éviter les recherches d'éléments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Le problème, pour ça, c'est que ce champ de modèle est calibré spécialement pour les élections (ça se voit en regardant le message d'erreur, qui parle de candidats plutôt que de choix).
Or, si on met un widget, il ne sera pas utilisé, puisque le formulaire de la page des élections est presque intégralement créé manuellement, pour coller aux exigences d'affichage qu'on a.
Je pourrais tenter de rendre le truc plus générique, mais ça sera du code mort, et je serai même pas sûr que ça marche comme on veut.
349e90f to
455e1d8
Compare
5888b96 to
b5863a7
Compare
b5863a7 to
b77fc2c
Compare
b77fc2c to
6b5268c
Compare
Refactor des élections pour résoudres quelques problèmes :