Display proposal result status in proposal admin change lists

feedback from pycon development

commit 3401cdd8253d86e166d980a1d1eb5ba2de01932d
Author: Dan Poirier <dpoirier@caktusgroup.com>
Date:   Thu Jun 6 15:10:57 2013 -0400

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
This commit is contained in:
Hiroshi Miura 2015-06-17 08:30:41 +09:00
parent 7ff4c0b4ef
commit 464d85b36a

View file

@ -8,6 +8,7 @@ from django.utils.translation import ugettext_lazy as _
from django.utils.timezone import now from django.utils.timezone import now
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
import reversion import reversion
@ -124,6 +125,13 @@ class ProposalBase(models.Model):
def number(self): def number(self):
return str(self.pk).zfill(3) return str(self.pk).zfill(3)
@property
def status(self):
try:
return self.result.status
except ObjectDoesNotExist:
return 'undecided'
def speakers(self): def speakers(self):
yield self.speaker yield self.speaker
speakers = self.additional_speakers.exclude( speakers = self.additional_speakers.exclude(