cmsmanage/rentals/forms.py
Adam Goldsmith e14e57c39e [rentals] Use django-autocomplete-light for locker renter selection
This primarily to make the list of members not block/slow down
loading excessively, as it was currently doing
2022-05-05 17:23:36 -04:00

25 lines
561 B
Python

from django import forms
from dal import autocomplete
from rentals.models import LockerInfo
class LockerInfoForm(forms.ModelForm):
class Meta:
model = LockerInfo
fields = [
"blind_code",
"bitting_code",
"renter",
"reserved",
]
widgets = {
"renter": autocomplete.ModelSelect2(
url="membershipworks:member-autocomplete",
attrs={
"data-placeholder": "-- No Renter --",
},
)
}