From c7dcd5343f7285e6ae7308435f4ed407ac3e7464 Mon Sep 17 00:00:00 2001 From: Sanj Date: Sun, 22 Apr 2012 20:22:23 +0530 Subject: [PATCH] foo --- manifests/ships/models.py | 8 ++++++++ manifests/templates/shipList.html | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/manifests/ships/models.py b/manifests/ships/models.py index 48b3e24..ed637d7 100644 --- a/manifests/ships/models.py +++ b/manifests/ships/models.py @@ -86,6 +86,14 @@ class Good(models.Model): weight = models.IntegerField(max_length=20, null=True) value = models.IntegerField(max_length=20, null=True) + def get_description(self): + if description_string_trans != '': + return self.description_string_trans + if description_string != '': + return self.description_string + else: + return self.description + def __unicode__(self): return self.description diff --git a/manifests/templates/shipList.html b/manifests/templates/shipList.html index 7487c07..08784d6 100644 --- a/manifests/templates/shipList.html +++ b/manifests/templates/shipList.html @@ -122,7 +122,7 @@ No of results: {{ no_of_results }}   displaying page {{ page }} of {{ no_of {% for good in s.good_set.all %} - +
{{ good.description_string_trans }}{{ good.get_description }} {{ good.no_of_packages }} {{ good.weight }}