mirror of
https://github.com/inventree/InvenTree.git
synced 2026-10-07 10:51:17 +00:00
Render filter options as a template
- This allows the values to be seen by the translation layer - Also means that whenever a new option is added, it will be automatically available to the front-end!
This commit is contained in:
1 parent
57c5d6c97a
commit
c1b59eeaab
5 files changed
+78
-46
No files matched your search
@@ -7,10 +7,22 @@ from InvenTree import version
|
||||
from InvenTree.helpers import decimal2string
|
||||
|
||||
from common.models import InvenTreeSetting
|
||||
from InvenTree.status_codes import OrderStatus, StockStatus, BuildStatus
|
||||
|
||||
register = template.Library()
|
||||
|
||||
|
||||
@register.simple_tag(takes_context=True)
|
||||
def load_status_codes(context):
|
||||
|
||||
context['order_status_codes'] = OrderStatus.list()
|
||||
context['stock_status_codes'] = StockStatus.list()
|
||||
context['build_status_codes'] = BuildStatus.list()
|
||||
|
||||
# Need to return something as the result is rendered to the page
|
||||
return ''
|
||||
|
||||
|
||||
@register.simple_tag()
|
||||
def decimal(x, *args, **kwargs):
|
||||
""" Simplified rendering of a decimal number """
|
||||
|
||||
Reference in new issue
Block a user