1
0
mirror of https://gitlab.crans.org/mediatek/med.git synced 2025-07-05 17:23:55 +02:00

Remove old views

This commit is contained in:
Alexandre Iooss
2019-08-09 22:26:32 +02:00
parent b4cfb8d3b6
commit 7f2f22f156
16 changed files with 56 additions and 363 deletions

View File

@ -2,32 +2,12 @@
# Copyright (C) 2017-2019 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
from django import forms
from django.forms import ModelForm
from .models import Jeu, Emprunt
class JeuForm(ModelForm):
class Meta:
model = Jeu
fields = '__all__'
def clean_nombre_joueurs_max(self):
max_player = self.cleaned_data['nombre_joueurs_max']
if max_player < self.cleaned_data['nombre_joueurs_min']:
raise forms.ValidationError("Max ne peut être inférieur à min")
return max_player
from .models import Emprunt
class EmpruntForm(ModelForm):
class Meta:
model = Emprunt
fields = ['media']
class EditEmpruntForm(ModelForm):
class Meta:
model = Emprunt
fields = ['media', 'permanencier_emprunt', 'permanencier_rendu',
'date_rendu']