This commit is contained in:
2025-07-15 20:57:15 +03:00
parent f6c78a20a3
commit 0ffd79cee9
51 changed files with 1227 additions and 653 deletions
+19
View File
@@ -0,0 +1,19 @@
from django.forms import ModelForm, CheckboxSelectMultiple
from containers.models import Container
from payments.models import Payment
class PaymentCreateForm(ModelForm):
class Meta:
model = Payment
fields = ['total_amount', 'company', 'description']
widgets = {
'containers': CheckboxSelectMultiple(),
}
# def __init__(self, *args, **kwargs):
# super().__init__(*args, **kwargs)
# self.fields['containers'].queryset = Container.objects.all()
# self.fields['containers'].label_from_instance = lambda obj: f"{obj.name} ({obj.company.name})"