[ADD] HORILLA VIEWS: get_item method

This commit is contained in:
Horilla
2024-11-05 10:26:38 +05:30
parent 312769d39d
commit ca258ab244

View File

@@ -120,3 +120,11 @@ def col(field: object):
field_name = field.name
cols = getattr(field.form, "cols", {})
return cols.get(field_name, 6)
@register.filter("get_item")
def get_item(dictionary: dict, key: str):
"""
get_item method to access from dictionary
"""
return dictionary.get(key, "")