Debugging, and make get_name function accessable (should really be renamed)

This commit is contained in:
Martin Green
2011-05-02 02:15:54 +01:00
parent 3f4ba904e2
commit 4a3ccc728b
2 changed files with 29 additions and 25 deletions

View File

@@ -70,11 +70,6 @@ def getTripForm(expedition):
return self.cleaned_data
class PersonTripForm(forms.Form):
def get_name(pe):
if pe.nickname:
return pe.nickname
else:
return pe.person.first_name
names = [get_name(pe) for pe in PersonExpedition.objects.filter(expedition = expedition)]
names.sort()
names = ["-----"] + names
@@ -86,3 +81,8 @@ def getTripForm(expedition):
return PersonTripFormSet, TripForm
def get_name(pe):
if pe.nickname:
return pe.nickname
else:
return pe.person.first_name