Last time i did something like this i had enumerated values for statues that had to be translated to other languages so i could not afford to depend on the string value of status as class in CSS, so i used choices like this:
Define choices in your models.py
class SomeModel(models.Model):
STATUS_CHOICES = (
(1, _('Pending')),
(2, _('Closed')),
)
status = models.IntegerField(choices=STATUS_CHOICES)
With HTML looking something like this:
<td class="color_{{ model_instance.status }}">
{{ model_instance.status.get_status_display }}
</td>
And your CSS should be similar to:
td.color_1{ color: green; }
td.color_2{ color: yellow; }
Basically you could change the status string value without changing CSS, same could be done if the status is enumerated value connected by foreign key for example. There are other ways to do it, but the answer mmrs151 gave is simplest and sufficient in most cases.