Project_Camper/vagus/reservation/forms.py

23 lines
607 B
Python
Raw Normal View History

2021-01-17 17:10:04 +01:00
from django import forms
from .models import Reservation
from camper.models import Offer
from users.models import Base_User
from django.core.exceptions import ValidationError
class ReservationForm(forms.ModelForm):
reservation_start_date = forms.DateField(required=True)
reservation_end_date = forms.DateField(required=True,)
class Meta:
model = Reservation
exclude = ('user',)
widget = {
'reservation_start_date': forms.DateInput(format =['%d/%m/%y']),
'reservation_end_date': forms.DateInput(format =['%d/%m/%y']),
}