From 6424b4a9f1c73203588fdd4d67f93ec396aac567 Mon Sep 17 00:00:00 2001 From: Tollef Fog Heen Date: Wed, 1 Aug 2012 20:29:13 +0200 Subject: [PATCH] Make it possible to find the given status text for a status value --- invoice/models.py | 5 +++++ 1 file changed, 5 insertions(+) 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) -- 2.39.5