From d9053097936160b6d6859a7885d70d6f59698c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Sun, 5 Jun 2016 02:16:14 +0200 Subject: [PATCH] Mise en forme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Formatage 80 colonnes et, suppression des espaces autour des signes `=` dans les arguments nommés et suppression d'un import inutile. --- bda/forms.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bda/forms.py b/bda/forms.py index 8a652296..d61623db 100644 --- a/bda/forms.py +++ b/bda/forms.py @@ -1,7 +1,7 @@ # coding: utf-8 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 class BaseBdaFormSet(BaseInlineFormSet): @@ -19,19 +19,21 @@ class BaseBdaFormSet(BaseInlineFormSet): spectacle = form.cleaned_data['spectacle'] delete = form.cleaned_data['DELETE'] 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) class TokenForm(forms.Form): - token = forms.CharField(widget = forms.widgets.Textarea()) + token = forms.CharField(widget=forms.widgets.Textarea()) class SpectacleModelChoiceField(forms.ModelChoiceField): 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): count = forms.ChoiceField(choices = (("1","1"),("2","2"),)) - spectacle = SpectacleModelChoiceField(queryset = Spectacle.objects.none()) + spectacle = SpectacleModelChoiceField(queryset=Spectacle.objects.none()) def __init__(self, participant, *args, **kwargs): super(ResellForm, self).__init__(*args, **kwargs)