Mise en forme
Formatage 80 colonnes et, suppression des espaces autour des signes `=` dans les arguments nommés et suppression d'un import inutile.
This commit is contained in:
parent
77f678c791
commit
d905309793
1 changed files with 7 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.forms.models import inlineformset_factory, BaseInlineFormSet
|
from django.forms.models import BaseInlineFormSet
|
||||||
from bda.models import Spectacle, Participant, ChoixSpectacle, Attribution
|
from bda.models import Spectacle, Participant, ChoixSpectacle, Attribution
|
||||||
|
|
||||||
class BaseBdaFormSet(BaseInlineFormSet):
|
class BaseBdaFormSet(BaseInlineFormSet):
|
||||||
|
@ -19,7 +19,8 @@ class BaseBdaFormSet(BaseInlineFormSet):
|
||||||
spectacle = form.cleaned_data['spectacle']
|
spectacle = form.cleaned_data['spectacle']
|
||||||
delete = form.cleaned_data['DELETE']
|
delete = form.cleaned_data['DELETE']
|
||||||
if not delete and spectacle in spectacles:
|
if not delete and spectacle in spectacles:
|
||||||
raise forms.ValidationError("Vous ne pouvez pas vous inscrire deux fois pour le même spectacle.")
|
raise forms.ValidationError("Vous ne pouvez pas vous " + \
|
||||||
|
"inscrire deux fois pour le même spectacle.")
|
||||||
spectacles.append(spectacle)
|
spectacles.append(spectacle)
|
||||||
|
|
||||||
class TokenForm(forms.Form):
|
class TokenForm(forms.Form):
|
||||||
|
@ -27,7 +28,8 @@ class TokenForm(forms.Form):
|
||||||
|
|
||||||
class SpectacleModelChoiceField(forms.ModelChoiceField):
|
class SpectacleModelChoiceField(forms.ModelChoiceField):
|
||||||
def label_from_instance(self, obj):
|
def label_from_instance(self, obj):
|
||||||
return u"%s le %s (%s) à %.02f€" % (obj.title, obj.date_no_seconds(), obj.location, obj.price)
|
return u"%s le %s (%s) à %.02f€" % (obj.title, obj.date_no_seconds(),
|
||||||
|
obj.location, obj.price)
|
||||||
|
|
||||||
class ResellForm(forms.Form):
|
class ResellForm(forms.Form):
|
||||||
count = forms.ChoiceField(choices = (("1","1"),("2","2"),))
|
count = forms.ChoiceField(choices = (("1","1"),("2","2"),))
|
||||||
|
|
Loading…
Reference in a new issue