From 8d9be6e43946fb288829b7278cdf4bbdb1a99a31 Mon Sep 17 00:00:00 2001 From: Med Date: Wed, 5 Jul 2017 01:14:57 +0200 Subject: [PATCH] =?UTF-8?q?Modifie=20la=20fa=C3=A7on=20dont=20les=20auteur?= =?UTF-8?q?s=20sont=20ajout=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- media/forms.py | 2 ++ users/models.py | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/media/forms.py b/media/forms.py index 5903892..44799ce 100644 --- a/media/forms.py +++ b/media/forms.py @@ -30,6 +30,8 @@ class AuteurForm(ModelForm): fields = '__all__' class MediaForm(ModelForm): + auteur = forms.ModelMultipleChoiceField(Auteur.objects.all(), widget=forms.CheckboxSelectMultiple, required=False) + class Meta: model = Media fields = '__all__' diff --git a/users/models.py b/users/models.py index f97f6e3..c28bae9 100644 --- a/users/models.py +++ b/users/models.py @@ -269,11 +269,10 @@ class ClefForm(ModelForm): fields = '__all__' class AdhesionForm(ModelForm): - adherent = forms.ModelMultipleChoiceField(User.objects.all(), widget=forms.CheckboxSelectMultiple) + adherent = forms.ModelMultipleChoiceField(User.objects.all(), widget=forms.CheckboxSelectMultiple, required=False) class Meta: model = Adhesion -# fields = ['annee_debut', 'annee_fin'] fields = '__all__' class RightForm(ModelForm):