TandoorRecipes/cookbook/helper/HelperFunctions.py
2021-12-28 12:03:31 -06:00

14 lines
247 B
Python

from django.db.models import Func
class Round(Func):
function = 'ROUND'
template = '%(function)s(%(expressions)s, 0)'
def str2bool(v):
if type(v) == bool:
return v
else:
return v.lower() in ("yes", "true", "1")