From: Tollef Fog Heen Date: Wed, 1 Aug 2012 18:29:13 +0000 (+0200) Subject: Make it possible to find the given status text for a status value X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6424b4a9f1c73203588fdd4d67f93ec396aac567;p=peojumk Make it possible to find the given status text for a status value --- diff --git a/invoice/models.py b/invoice/models.py index a73bf91..89eb481 100644 --- a/invoice/models.py +++ b/invoice/models.py @@ -30,6 +30,11 @@ BOOTSTRAP_COLOUR_MAP = { from datetime import date +def status_text(status): + for (k,v) in INVOICE_STATUS_CHOICES: + if k == status: + return v + class Invoice(models.Model): """An invoice""" customer = models.ForeignKey(Client)