mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Style fixes
This commit is contained in:
parent
5908890726
commit
e978e1df52
@ -6,7 +6,7 @@ import os
|
|||||||
from django import template
|
from django import template
|
||||||
from InvenTree import version, settings
|
from InvenTree import version, settings
|
||||||
|
|
||||||
from InvenTree.helpers import decimal2string
|
import InvenTree.helpers
|
||||||
|
|
||||||
from common.models import InvenTreeSetting, ColorTheme
|
from common.models import InvenTreeSetting, ColorTheme
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ register = template.Library()
|
|||||||
def decimal(x, *args, **kwargs):
|
def decimal(x, *args, **kwargs):
|
||||||
""" Simplified rendering of a decimal number """
|
""" Simplified rendering of a decimal number """
|
||||||
|
|
||||||
return decimal2string(x)
|
return InvenTree.helpers.decimal2string(x)
|
||||||
|
|
||||||
|
|
||||||
@register.simple_tag()
|
@register.simple_tag()
|
||||||
@ -26,6 +26,7 @@ def str2bool(x, *args, **kwargs):
|
|||||||
|
|
||||||
return InvenTree.helpers.str2bool(x)
|
return InvenTree.helpers.str2bool(x)
|
||||||
|
|
||||||
|
|
||||||
@register.simple_tag()
|
@register.simple_tag()
|
||||||
def inrange(n, *args, **kwargs):
|
def inrange(n, *args, **kwargs):
|
||||||
""" Return range(n) for iterating through a numeric quantity """
|
""" Return range(n) for iterating through a numeric quantity """
|
||||||
@ -35,7 +36,7 @@ def inrange(n, *args, **kwargs):
|
|||||||
@register.simple_tag()
|
@register.simple_tag()
|
||||||
def multiply(x, y, *args, **kwargs):
|
def multiply(x, y, *args, **kwargs):
|
||||||
""" Multiply two numbers together """
|
""" Multiply two numbers together """
|
||||||
return decimal2string(x * y)
|
return InvenTree.helpers.decimal2string(x * y)
|
||||||
|
|
||||||
|
|
||||||
@register.simple_tag()
|
@register.simple_tag()
|
||||||
@ -48,7 +49,7 @@ def add(x, y, *args, **kwargs):
|
|||||||
def part_allocation_count(build, part, *args, **kwargs):
|
def part_allocation_count(build, part, *args, **kwargs):
|
||||||
""" Return the total number of <part> allocated to <build> """
|
""" Return the total number of <part> allocated to <build> """
|
||||||
|
|
||||||
return decimal2string(build.getAllocatedQuantity(part))
|
return InvenTree.helpers.decimal2string(build.getAllocatedQuantity(part))
|
||||||
|
|
||||||
|
|
||||||
@register.simple_tag()
|
@register.simple_tag()
|
||||||
|
Loading…
Reference in New Issue
Block a user