cmsmanage/rentals/forms.py

21 lines
482 B
Python
Raw Normal View History

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",
]