From 86474625a41a3fbf383cb798e3226fd6a64c29d4 Mon Sep 17 00:00:00 2001 From: Lee Phillips Date: Mon, 6 Oct 2014 13:54:20 -0400 Subject: [PATCH] Display full names as well as usernames in the assign_to dropdown when adding a task. --- todo/forms.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/todo/forms.py b/todo/forms.py index 6da8725..78589b6 100644 --- a/todo/forms.py +++ b/todo/forms.py @@ -24,6 +24,9 @@ class AddItemForm(ModelForm): # print dir(self.fields['list']) # print self.fields['list'].initial self.fields['assigned_to'].queryset = User.objects.filter(groups__in=[task_list.group]) + self.fields['assigned_to'].label_from_instance = lambda obj: "%s (%s)" % ( + obj.get_full_name(), obj.username) + due_date = forms.DateField( required=False,