[ADD] HORILLA VIEWS: get_item method
This commit is contained in:
@@ -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, "")
|
||||
|
||||
Reference in New Issue
Block a user