我有一个预订模型。该模型分为4个模型形式。我需要将一些数据发布到第一个表单,所以它会被初始化。那可能吗?如果是这样,怎么做?
以下是forms.py中的相关表格:
class ServiceChoiceForm(forms.ModelForm):
class Meta:
model = Booking
fields = ('service', 'object_id', )
class ShuttleBookingForm(forms.ModelForm):
class Meta:
model = Booking
fields = ('vehicle', 'date', 'time', 'arriving_by', 'flight_number', 'notes', )
class PersonalInfoBookingForm(forms.ModelForm):
class Meta:
model = Booking
fields = ('first_name', 'last_name', 'phone', 'email', )
class GeneralBookingInfoForm(forms.ModelForm):
class Meta:
model = Booking
fields = ('adults', 'children', 'gadgets', 'accommodation', )