Skip to content

Commit

Permalink
support Z2 BoundPageTemplates, not just Z3's
Browse files Browse the repository at this point in the history
  • Loading branch information
davisagli committed Jul 23, 2009
1 parent d7b6de5 commit f39b1f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ CHANGES
five.customerize 0.4 (unreleased)
---------------------------------

Support Zope 2.12's BoundPageTemplateFile.

Fixed deprecation warnings for use of Globals.

Specify all package dependencies.
Expand Down
5 changes: 3 additions & 2 deletions src/five/customerize/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
from AccessControl import Unauthorized
from Products.PageTemplates.PageTemplateFile import PageTemplateFile as Z2PTF
from zope.pagetemplate.pagetemplatefile import PageTemplateFile as Z3PTF
from zope.app.pagetemplate.viewpagetemplatefile import BoundPageTemplate
from Products.Five.browser.pagetemplatefile import BoundPageTemplate as Z2BPT
from zope.app.pagetemplate.viewpagetemplatefile import BoundPageTemplate as Z3BPT


def isTemplate(obj):
""" check if the given object is a or is derived from a template class """
# TODO: we should really check via interfaces, i.e. `providedBy` here,
# but the only class using interfaces atm is Z3PTF :(
return isinstance(obj, Z2PTF) or isinstance(obj, Z3PTF) or \
isinstance(obj, BoundPageTemplate)
isinstance(obj, Z2BPT) or isinstance(obj, Z3BPT)


def findViewletTemplate(viewlet):
Expand Down

0 comments on commit f39b1f3

Please sign in to comment.