Stop configuring FormAlchemy engine etc. on app startup

This commit is contained in:
Lance Edgar 2018-02-11 22:41:20 -06:00
parent dd04459748
commit 66769ab34b

View file

@ -122,9 +122,6 @@ def make_pyramid_config(settings, configure_csrf=True):
""" """
Make a Pyramid config object from the given settings. Make a Pyramid config object from the given settings.
""" """
from tailbone.forms.alchemy import TemplateEngine
from tailbone.forms import renderers
config = settings.pop('pyramid_config', None) config = settings.pop('pyramid_config', None)
if config: if config:
config.set_root_factory(Root) config.set_root_factory(Root)
@ -158,14 +155,6 @@ def make_pyramid_config(settings, configure_csrf=True):
for key, label in perms: for key, label in perms:
config.add_tailbone_permission(groupkey, key, label) config.add_tailbone_permission(groupkey, key, label)
# Configure FormAlchemy.
fa.config.engine = TemplateEngine()
fa.FieldSet.default_renderers[sa.Boolean] = renderers.YesNoFieldRenderer
fa.FieldSet.default_renderers[sa.Date] = renderers.DateFieldRenderer
fa.FieldSet.default_renderers[sa.DateTime] = renderers.DateTimeFieldRenderer
fa.FieldSet.default_renderers[sa.Time] = renderers.TimeFieldRenderer
fa.FieldSet.default_renderers[GPCType] = renderers.GPCFieldRenderer
return config return config