show last digits in helper names

pull/1/head
parent 552529cd6b
commit 9afd3cf290

@ -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")
) )

Loading…
Cancel
Save