2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-21 06:16:29 +00:00

Adds simple test-report template

This commit is contained in:
Oliver Walters
2021-02-04 15:29:46 +11:00
parent ddbf2a6313
commit a025b7239d
4 changed files with 161 additions and 23 deletions

View File

@ -1,22 +0,0 @@
"""
Custom template tags for report generation
"""
import os
from django import template
from django.conf import settings
register = template.Library()
@register.simple_tag()
def asset(filename):
"""
Return fully-qualified path for an upload report asset file.
"""
path = os.path.join(settings.MEDIA_ROOT, 'report', 'assets', filename)
path = os.path.abspath(path)
return f"file://{path}"