21 lines
482 B
Python
21 lines
482 B
Python
|
from django import forms
|
||
|
|
||
|
from rentals.models import LockerInfo
|
||
|
|
||
|
|
||
|
class BoostrapModelForm(forms.ModelForm):
|
||
|
def __init__(self, *args, **kwargs):
|
||
|
super().__init__(*args, **kwargs)
|
||
|
for field in self.fields.values():
|
||
|
field.widget.attrs["class"] = "form-control"
|
||
|
|
||
|
|
||
|
class LockerInfoForm(BoostrapModelForm):
|
||
|
class Meta:
|
||
|
model = LockerInfo
|
||
|
fields = [
|
||
|
"blind_code",
|
||
|
"bitting_code",
|
||
|
"renter",
|
||
|
]
|