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