diff --git a/port/forms.py b/port/forms.py index c2dc199..b8e6518 100644 --- a/port/forms.py +++ b/port/forms.py @@ -125,5 +125,16 @@ class TapForm(Form): TapFormSet = formset_factory(TapForm) -class BoatForm(Form): +class BoatForm(ModelForm): + class Meta: + model = Boat + fields = ['name', + 'length', 'beam', + 'water_draught', + 'tonnage', + 'water_tank', + 'model', + 'heating', + 'passenger_capacity', + 'picture'] diff --git a/port/models.py b/port/models.py index cbf4992..f71c101 100644 --- a/port/models.py +++ b/port/models.py @@ -45,12 +45,12 @@ class Insurance(Company): class Boat(Model): name = CharField(max_length=50) - registration_num = CharField(max_length=20,null=True) - length = DecimalField(max_digits=7, decimal_places=2, null=True) - beam = DecimalField(max_digits=7, decimal_places=2, null=True) + registration_num = CharField('Registration number', max_length=20,null=True) + length = DecimalField('Length', max_digits=7, decimal_places=2, null=True) + beam = DecimalField(, max_digits=7, decimal_places=2, null=True) water_draught = DecimalField(max_digits=7, decimal_places=2, null=True) tonnage = DecimalField(max_digits=7, decimal_places=2, null=True) - water_tank = DecimalField(max_digits=7, decimal_places=2, null=True) + water_tank = DecimalField('Water tank capacity', max_digits=7, decimal_places=2, null=True) model = CharField(max_length=50,null=True) heating = CharField(max_length=50,null=True) passenger_capacity = IntegerField(null=True)