tag to read out dict value

This commit is contained in:
Matthias 2021-06-17 23:09:50 +02:00
parent bc46cca9f0
commit 58b6bbb236

View File

@ -208,6 +208,17 @@ def get_color_theme_css(username):
return inventree_css_static_url
@register.filter
def keyvalue(dict, key):
"""
access to key of supplied dict
usage:
{% mydict|keyvalue:mykey %}
"""
return dict[key]
@register.simple_tag()
def authorized_owners(group):
""" Return authorized owners """