You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
depot_django/booking/forms.py

26 lines
674 B
Python

from django import forms
from booking.models import Booking
class BookingBaseForm(forms.ModelForm):
"""
Base form for booking-related forms.
This can be extended by other booking forms.
"""
class Meta:
fields = '__all__'
model = Booking
class BookingCreateForm(BookingBaseForm):
class Meta(BookingBaseForm.Meta):
fields = ['number', 'vehicles', 'container_type', 'container_count', 'carrier', 'line', 'container_number']
class BookingUpdateForm(BookingBaseForm):
class Meta(BookingBaseForm.Meta):
fields = ['number', 'vehicles', 'container_type', 'container_count', 'carrier', 'line', 'container_number']