add filter for getting label out of options list
This commit is contained in:
parent
6ef1914d2d
commit
55bf70ddf7
@ -26,9 +26,14 @@ def readableInteger(value):
|
|||||||
return "{:,}".format(numberValue)
|
return "{:,}".format(numberValue)
|
||||||
|
|
||||||
|
|
||||||
|
def getOptionLabel(value, options):
|
||||||
|
return next(tup[1] for tup in options if tup[0] == value)
|
||||||
|
|
||||||
|
|
||||||
def register_filters(app):
|
def register_filters(app):
|
||||||
app.jinja_env.filters['iconSvg'] = iconSvg
|
app.jinja_env.filters['iconSvg'] = iconSvg
|
||||||
app.jinja_env.filters['dollars'] = dollars
|
app.jinja_env.filters['dollars'] = dollars
|
||||||
app.jinja_env.filters['usPhone'] = usPhone
|
app.jinja_env.filters['usPhone'] = usPhone
|
||||||
app.jinja_env.filters['readableInteger'] = readableInteger
|
app.jinja_env.filters['readableInteger'] = readableInteger
|
||||||
|
app.jinja_env.filters['getOptionLabel'] = getOptionLabel
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user