mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-02-24 17:11:18 +00:00
Compare commits
No commits in common. "802a6c68cb32076b748c3b414fcd654326e71433" and "aa35724be259cf4299799271f89369553da406cc" have entirely different histories.
802a6c68cb
...
aa35724be2
@ -138,7 +138,7 @@ class WEIMembershipForm(forms.ModelForm):
|
|||||||
class BusForm(forms.ModelForm):
|
class BusForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Bus
|
model = Bus
|
||||||
fields = '__all__'
|
exclude = ('information_json',)
|
||||||
widgets = {
|
widgets = {
|
||||||
"wei": Autocomplete(
|
"wei": Autocomplete(
|
||||||
WEIClub,
|
WEIClub,
|
||||||
|
@ -10,16 +10,14 @@ from django.utils.translation import gettext_lazy as _
|
|||||||
from .base import WEISurvey, WEISurveyInformation, WEISurveyAlgorithm, WEIBusInformation
|
from .base import WEISurvey, WEISurveyInformation, WEISurveyAlgorithm, WEIBusInformation
|
||||||
from ...models import Bus
|
from ...models import Bus
|
||||||
|
|
||||||
WORDS = [
|
|
||||||
'13 organisé', '3ième mi temps', 'Années 2000', 'Apéro', 'BBQ', 'BP', 'Beauf', 'Binge drinking', 'Bon enfant',
|
# TODO: Use new words
|
||||||
'Cartouche', 'Catacombes', 'Chansons paillardes', 'Chansons populaires', 'Chanteur', 'Chartreuse', 'Chill',
|
WORDS = ['Rap', 'Retro', 'DJ', 'Rock', 'Jazz', 'Chansons Populaires', 'Chansons Paillardes', 'Pop', 'Fanfare',
|
||||||
'Core', 'DJ', 'Dancefloor', 'Danse', 'David Guetta', 'Disco', 'Eau de vie', 'Électro', 'Escalade', 'Familial',
|
'Biere', 'Pastis', 'Vodka', 'Cocktails', 'Eau', 'Sirop', 'Jus de fruit', 'Binge Drinking', 'Rhum',
|
||||||
'Fanfare', 'Fracassage', 'Féria', 'Hard rock', 'Hoeggarden', 'House', 'Huit-six', 'IPA', 'Inclusif', 'Inferno',
|
'Eau de vie', 'Apéro', 'Morning beer', 'Huit-six', 'Jeux de societé', 'Jeux de cartes', 'Danse', 'Karaoké',
|
||||||
'Introverti', 'Jager bomb', 'Jazz', 'Jeux d\'alcool', 'Jeux de rôles', 'Jeux vidéo', 'Jul', 'Jus de fruit',
|
'Bière Pong', 'Poker', 'Loup Garou', 'Films', "Jeux d'alcool", 'Sport', 'Rangées de cul', 'Chips', 'BBQ',
|
||||||
'Karaoké', 'LGBTQI+', 'Lady Gaga', 'Loup garou', 'Morning beer', 'Métal', 'Nuit blanche', 'Ovalie', 'Psychedelic',
|
'Kebab', 'Saucisse', 'Vegan', 'Vege', 'LGBTIQ+', 'Dab', 'Solitaire', 'Séducteur', 'Sociale', 'Chanteur',
|
||||||
'Pétanque', 'Rave', 'Reggae', 'Rhum', 'Ricard', 'Rock', 'Rosé', 'Rétro', 'Séducteur', 'Techno', 'Thérapie taxi',
|
'Se lacher', 'Chill', 'Débile', 'Beauf', 'Bon enfant']
|
||||||
'Théâtre', 'Trap', 'Turn up', 'Underground', 'Volley', 'Wati B', 'Zinédine Zidane',
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
class WEISurveyForm2021(forms.Form):
|
class WEISurveyForm2021(forms.Form):
|
||||||
@ -61,12 +59,9 @@ class WEIBusInformation2021(WEIBusInformation):
|
|||||||
"""
|
"""
|
||||||
For each word, the bus has a score
|
For each word, the bus has a score
|
||||||
"""
|
"""
|
||||||
scores: dict
|
|
||||||
|
|
||||||
def __init__(self, bus):
|
def __init__(self, bus):
|
||||||
self.scores = {}
|
|
||||||
for word in WORDS:
|
for word in WORDS:
|
||||||
self.scores[word] = 0.0
|
setattr(self, word, 0.0)
|
||||||
super().__init__(bus)
|
super().__init__(bus)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
# Generated by Django 2.2.19 on 2021-08-25 21:25
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('wei', '0002_auto_20210313_1235'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='bus',
|
|
||||||
name='size',
|
|
||||||
field=models.IntegerField(default=50, verbose_name='seat count in the bus'),
|
|
||||||
),
|
|
||||||
]
|
|
@ -66,11 +66,6 @@ class Bus(models.Model):
|
|||||||
verbose_name=_("name"),
|
verbose_name=_("name"),
|
||||||
)
|
)
|
||||||
|
|
||||||
size = models.IntegerField(
|
|
||||||
verbose_name=_("seat count in the bus"),
|
|
||||||
default=50,
|
|
||||||
)
|
|
||||||
|
|
||||||
description = models.TextField(
|
description = models.TextField(
|
||||||
blank=True,
|
blank=True,
|
||||||
default="",
|
default="",
|
||||||
@ -96,7 +91,7 @@ class Bus(models.Model):
|
|||||||
"""
|
"""
|
||||||
Store information as a JSON string
|
Store information as a JSON string
|
||||||
"""
|
"""
|
||||||
self.information_json = json.dumps(information, indent=2)
|
self.information_json = json.dumps(information)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
@ -260,7 +255,7 @@ class WEIRegistration(models.Model):
|
|||||||
"""
|
"""
|
||||||
Store information as a JSON string
|
Store information as a JSON string
|
||||||
"""
|
"""
|
||||||
self.information_json = json.dumps(information, indent=2)
|
self.information_json = json.dumps(information)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_validated(self):
|
def is_validated(self):
|
||||||
|
@ -344,8 +344,6 @@ class BusUpdateView(ProtectQuerysetMixin, LoginRequiredMixin, UpdateView):
|
|||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
context = super().get_context_data(**kwargs)
|
context = super().get_context_data(**kwargs)
|
||||||
context["club"] = self.object.wei
|
context["club"] = self.object.wei
|
||||||
context["information"] = CurrentSurvey.get_algorithm_class().get_bus_information(self.object)
|
|
||||||
self.object.save()
|
|
||||||
return context
|
return context
|
||||||
|
|
||||||
def get_form(self, form_class=None):
|
def get_form(self, form_class=None):
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user