]> err.no Git - peojumk/commitdiff
Make it possible to find the given status text for a status value
authorTollef Fog Heen <tfheen@err.no>
Wed, 1 Aug 2012 18:29:13 +0000 (20:29 +0200)
committerTollef Fog Heen <tfheen@err.no>
Wed, 1 Aug 2012 18:29:13 +0000 (20:29 +0200)
invoice/models.py

index a73bf91e7c77c238e31d56abaaec4801457152a5..89eb4811847c833e709b7b5ccd7c00f4794b18c9 100644 (file)
@@ -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)