diff --git a/netbox/utilities/templatetags/helpers.py b/netbox/utilities/templatetags/helpers.py index aa17728b7..cc0b3b2e4 100644 --- a/netbox/utilities/templatetags/helpers.py +++ b/netbox/utilities/templatetags/helpers.py @@ -36,6 +36,14 @@ def gfm(value): return mark_safe(html) +@register.filter() +def startswith(value, arg): + """ + Test whether a string starts with the given argument + """ + return str(value).startswith(arg) + + @register.filter() def user_can_add(model, user): perm_name = '{}:add_{}'.format(model._meta.app_label, model.__class__.__name__.lower())