Пример #1
0
from zope.interface import implements
from Products.Archetypes import atapi
from example.archetype import archetypeMessageFactory as _

from Products.ATContentTypes.content import base
from Products.ATContentTypes.content import schemata
from example.archetype.interfaces import IInstantMessage
from example.archetype import config

schema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

  atapi.StringField('priority',
              vocabulary=config.MESSAGE_PRIORITIES,
              default='normal',
              widget=atapi.SelectionWidget(label=_(u'Priority')),
             ),

  atapi.TextField('body',
            searchable=1,
            required=1,
            allowable_content_types=('text/plain',
                                       'text/structured',
                                       'text/html',),
            default_output_type='text/x-html-safe',
            widget=atapi.RichWidget(label=_(u'Message body')),
           ),
))


class InstantMessage(base.ATCTContent):
    """An Archetype for an InstantMessage application"""
Пример #2
0
            month.invokeFactory(type_name='Folder', id=str(now_day))
            day = getattr(month,str(now_day))
            month_flag,day_flag = 1,1
        if day_flag !=1:
            month.invokeFactory(type_name='Folder', id=str(now_day))
            day = getattr(month,str(now_day))
            
    day.manage_pasteObjects(cb_cut_data)
    #pdb.set_trace()

schema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

  atapi.StringField('priority',
              vocabulary = config.MESSAGE_PRIORITIES,
              default = 'normal',
              widget = atapi.SelectionWidget(label = _(u'Priority')),
             ),
  atapi.DateTimeField('customDate',
              widget = atapi.CalendarWidget(label=_(u'Custom Date')),
              ),
  atapi.TextField('body',
            searchable = 1,
            required = 1,
            allowable_content_types = ('text/plain',
                                       'text/structured',
                                       'text/html',),
            default_output_type = 'text/x-html-safe',
            widget = atapi.RichWidget(label = _(u'Message Body')),
           ),

))