mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 05:05:42 +00:00 
			
		
		
		
	new tag for url resolve
This commit is contained in:
		| @@ -11,7 +11,7 @@ from django.utils.translation import ugettext_lazy as _ | ||||
| from django.conf import settings as djangosettings | ||||
|  | ||||
| from django import template | ||||
| from django.urls import reverse | ||||
| from django.urls import reverse, resolve as resolve_fnc | ||||
| from django.utils.safestring import mark_safe | ||||
| from django.templatetags.static import StaticNode | ||||
| from InvenTree import version, settings | ||||
| @@ -267,6 +267,12 @@ def object_link(url_name, pk, ref): | ||||
|     return mark_safe('<b><a href="{}">{}</a></b>'.format(ref_url, ref)) | ||||
|  | ||||
|  | ||||
| @register.simple_tag() | ||||
| def resolve(url): | ||||
|     """provides access to resolve function in templates""" | ||||
|     return resolve_fnc(url) | ||||
|  | ||||
|  | ||||
| class I18nStaticNode(StaticNode): | ||||
|     """ | ||||
|     custom StaticNode | ||||
|   | ||||
		Reference in New Issue
	
	Block a user