This commit is contained in:
Sanj 2012-04-22 20:22:23 +05:30
parent 3dc562f3c2
commit c7dcd5343f
2 changed files with 9 additions and 1 deletions

View File

@ -86,6 +86,14 @@ class Good(models.Model):
weight = models.IntegerField(max_length=20, null=True) weight = models.IntegerField(max_length=20, null=True)
value = 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): def __unicode__(self):
return self.description return self.description

View File

@ -122,7 +122,7 @@ No of results: {{ no_of_results }}   displaying page {{ page }} of {{ no_of
<table class="goodTable"> <table class="goodTable">
{% for good in s.good_set.all %} {% for good in s.good_set.all %}
<tr> <tr>
<td>{{ good.description_string_trans }}</td> <td>{{ good.get_description }}</td>
<td>{{ good.no_of_packages }}</td> <td>{{ good.no_of_packages }}</td>
<td>{{ good.weight }}</td> <td>{{ good.weight }}</td>
</tr> </tr>