Back to index

plone3  3.1.7
_patches.py
Go to the documentation of this file.
00001 import logging
00002 from Products.Five.formlib import formbase
00003 
00004 def apply_patches():
00005 
00006     # Five's base class defines template as a ViewPageTemplateFile.
00007     # However, the base 'zope.formlib.form.FormBase' has 'template'
00008     # defined as a NamedTemplate, which is much nicer, and what we
00009     # want.
00010     if 'template' in formbase.FiveFormlibMixin.__dict__:
00011         logger = logging.getLogger('plone.app.form')
00012         logger.debug('*** MONKEYPATCH *** : delete "template" attribute of ' +
00013            'FiveFormlibMixin to allow use of named templates.')
00014         delattr(formbase.FiveFormlibMixin, 'template')