Last active
November 29, 2016 12:39
-
-
Save andresmachado/5c192c972d92ac7fc3bdab81b4f11503 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def format_result_color(self, obj): | |
if obj.media == 'A': | |
color = 'green' | |
elif obj.media == 'R': | |
color = 'red' | |
else: | |
color = 'orange' | |
return '<p style="color: {}">{}</p>'.format(color, obj.media) | |
format_result_color.allow_tags = True | |
list_display('format_result_color') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment