From 464d85b36a649525dbdfc3bb89fc2dbd21bac6fc Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Wed, 17 Jun 2015 08:30:41 +0900 Subject: [PATCH] Display proposal result status in proposal admin change lists feedback from pycon development commit 3401cdd8253d86e166d980a1d1eb5ba2de01932d Author: Dan Poirier Date: Thu Jun 6 15:10:57 2013 -0400 Signed-off-by: Hiroshi Miura --- symposion/proposals/models.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/symposion/proposals/models.py b/symposion/proposals/models.py index 3c953c39..b5880243 100644 --- a/symposion/proposals/models.py +++ b/symposion/proposals/models.py @@ -8,6 +8,7 @@ from django.utils.translation import ugettext_lazy as _ from django.utils.timezone import now from django.contrib.auth.models import User +from django.core.exceptions import ObjectDoesNotExist import reversion @@ -124,6 +125,13 @@ class ProposalBase(models.Model): def number(self): return str(self.pk).zfill(3) + @property + def status(self): + try: + return self.result.status + except ObjectDoesNotExist: + return 'undecided' + def speakers(self): yield self.speaker speakers = self.additional_speakers.exclude(