set color for status incomplete
This commit is contained in:
@@ -173,10 +173,12 @@ class BillAdmin(admin.ModelAdmin):
|
||||
get_bankdata_bic.short_description = "BIC"
|
||||
|
||||
def status_colored(self, obj):
|
||||
# TODO: if there is a status without color, set nothing.
|
||||
colors = {
|
||||
"S": "red",
|
||||
"C": "darkorange",
|
||||
"F": "green",
|
||||
"I": "blue",
|
||||
}
|
||||
return mark_safe(
|
||||
f'<b style="background:{colors[obj.status]};">{obj.get_status_display()}</b>'
|
||||
|
||||
Reference in New Issue
Block a user