Add a formatter for yes/no

This is a bit neater than a bunch of repetetive ternary statements.
This commit is contained in:
Chris Hill-Scott
2021-10-11 14:26:46 +01:00
parent f85ee3dd0a
commit fad3ff70f2
3 changed files with 8 additions and 2 deletions

View File

@@ -518,3 +518,7 @@ def format_mobile_network(network):
def format_billions(count):
return humanize.intword(count)
def format_yes_no(value):
return 'Yes' if value else 'No'