Add model
to global template context, plus h.maxlen()
sometimes it's nice to just add a `maxlength="100"` or whatever to an input tag within some random template. that should "just be possible" with no extra effort
This commit is contained in:
parent
7d158e58b5
commit
4371574403
|
@ -32,6 +32,7 @@ from decimal import Decimal
|
||||||
from rattail.time import localtime, make_utc
|
from rattail.time import localtime, make_utc
|
||||||
from rattail.util import (pretty_quantity, pretty_hours, hours_as_decimal,
|
from rattail.util import (pretty_quantity, pretty_hours, hours_as_decimal,
|
||||||
OrderedDict)
|
OrderedDict)
|
||||||
|
from rattail.db.util import maxlen
|
||||||
|
|
||||||
from webhelpers2.html import *
|
from webhelpers2.html import *
|
||||||
from webhelpers2.html.tags import *
|
from webhelpers2.html.tags import *
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
#
|
||||||
# Rattail -- Retail Software Framework
|
# Rattail -- Retail Software Framework
|
||||||
# Copyright © 2010-2019 Lance Edgar
|
# Copyright © 2010-2020 Lance Edgar
|
||||||
#
|
#
|
||||||
# This file is part of Rattail.
|
# This file is part of Rattail.
|
||||||
#
|
#
|
||||||
|
@ -99,6 +99,7 @@ def before_render(event):
|
||||||
renderer_globals['url'] = request.route_url
|
renderer_globals['url'] = request.route_url
|
||||||
renderer_globals['rattail'] = rattail
|
renderer_globals['rattail'] = rattail
|
||||||
renderer_globals['tailbone'] = tailbone
|
renderer_globals['tailbone'] = tailbone
|
||||||
|
renderer_globals['model'] = request.rattail_config.get_model()
|
||||||
renderer_globals['enum'] = request.rattail_config.get_enum()
|
renderer_globals['enum'] = request.rattail_config.get_enum()
|
||||||
renderer_globals['six'] = six
|
renderer_globals['six'] = six
|
||||||
renderer_globals['json'] = json
|
renderer_globals['json'] = json
|
||||||
|
|
Loading…
Reference in a new issue