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:
@ -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']
|
||||
|
Reference in New Issue
Block a user