Back to index

plone3  3.1.7
edit.py
Go to the documentation of this file.
00001 from zope.interface import implements
00002 
00003 from Acquisition import aq_inner
00004 from Products.CMFCore.utils import getToolByName
00005 from Products.Five import BrowserView
00006 
00007 from Products.Archetypes.interfaces import IEditForm
00008 from Products.Archetypes.interfaces import IMultiPageSchema
00009 
00010 from Products.Archetypes import PloneMessageFactory as _
00011 
00012 class Edit(BrowserView):
00013     implements(IEditForm)
00014 
00015     def isTemporaryObject(self):
00016         factory = getToolByName(aq_inner(self.context), 'portal_factory',
00017                                 None)
00018         if factory is not None:
00019             return factory.isTemporary(aq_inner(self.context))
00020         else:
00021             return False
00022 
00023     def isMultiPageSchema(self):
00024         return IMultiPageSchema.providedBy(self.context)
00025 
00026     def getTranslatedSchemaLabel(self, schema):
00027         label = u"label_schema_%s" % schema
00028         default = unicode(schema).capitalize()
00029         return _(label, default=default)