コード例 #1
0
class Assignment(base.Assignment):
    implements(ITALPortlet)

    title = u"" # overrides the readonly property method from the base class

    def __init__(self, title=u"", tal=u""):
        self.pt = ZopePageTemplate(id='__tal_portlet__')
        self.title = title
        self.tal = tal

    def _get_tal(self):
        return self.pt.read()
    def _set_tal(self, value):
        self.pt.pt_edit(value, 'text/html')
    tal = property(_get_tal, _set_tal)
コード例 #2
0
class Assignment(base.Assignment):

    title = u""  # overrides the readonly property method from the base class

    def __init__(self, title=u"", tal=u""):
        self.pt = ZopePageTemplate(id='__tal_portlet__')
        self.title = title
        self.tal = tal

    def _get_tal(self):
        return self.pt.read()

    def _set_tal(self, value):
        self.pt.pt_edit(value, 'text/html')

    tal = property(_get_tal, _set_tal)