2
0
Fork 0

show last digits in helper names

This commit is contained in:
Andreas (@xAndy) Zimmermann 2022-05-20 15:38:03 +02:00
parent 552529cd6b
commit 9afd3cf290
1 changed files with 5 additions and 1 deletions

View File

@ -6,8 +6,12 @@ class EmptyForm(forms.Form):
pass pass
class NameField(forms.ModelChoiceField):
def label_from_instance(self, user):
return f"{user.name} ({(str(user.phone))[-3:]})"
class HelperShift(forms.Form): class HelperShift(forms.Form):
helper = forms.ModelChoiceField( helper = NameField(
label="Helfer*in", queryset=Helper.objects.order_by("name") label="Helfer*in", queryset=Helper.objects.order_by("name")
) )