Add a pdm script to run code formatters
This commit is contained in:
parent
24e8bf819b
commit
55bccb930f
@ -47,6 +47,7 @@ lint = [
|
||||
|
||||
[tool.pdm.scripts]
|
||||
start = "./manage.py runserver"
|
||||
fmt.shell = "black . && djlint --reformat ."
|
||||
|
||||
[build-system]
|
||||
requires = ["pdm-pep517"]
|
||||
|
20
rentals/forms.py
Normal file
20
rentals/forms.py
Normal file
@ -0,0 +1,20 @@
|
||||
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",
|
||||
]
|
Loading…
Reference in New Issue
Block a user