コード例 #1
0
 def entry_types(self):
     pt = getToolByName(self, 'portal_types')
     derived_types = {}
     for fti in pt.listTypeInfo():
         # first item always "FormSaveData2ContentEntry"
         if fti.getId()=='FormSaveData2ContentEntry':
             first = fti
         elif fti.getProperty('product') == 'uwosh.pfg.d2c':
             derived_types[fti.getId()] = fti.getProperty('title')
     if "FormSaveData2ContentAdapter" in derived_types:
         del derived_types["FormSaveData2ContentAdapter"]
     return DisplayList([(first.getId(), _(first.getProperty('title')))] + \
                                 [(t[0], _(t[1])) for t in derived_types.items()])
コード例 #2
0
    class DataGridField:
        pass

from uwosh.pfg.d2c.config import PROJECTNAME
from uwosh.pfg.d2c import pfgMessageFactory as _
from uwosh.pfg.d2c.interfaces import IFormSaveData2ContentAdapter
from uwosh.pfg.d2c.events import FormSaveData2ContentEntryFinalizedEvent
from uwosh.pfg.d2c.utils import executeAsManager

FormSaveData2ContentAdapterSchema = ATFolderSchema.copy() + \
    NextPreviousAwareSchema.copy() + \
    FormAdapterSchema.copy() + Schema((
        BooleanField('avoidSecurityChecks',
            default=True,
            widget=BooleanWidget(
                label=_("label_savecontentadapter_avoidsecuritychecks",
                        default=u"Avoid Security Checks"),
                description=_('help_savecontentadapter_avoidsecuritychecks',
                              default=u"Avoid checking if the user has permission to create the content "
                                      u"data. You will almost always want this checked; otherwise, "
                                      u"anonymous users will most likely not be able to submit your "
                                      u"forms."
                              ),
            )
        ),
        StringField('titleField',
            searchable=False,
            required=False,
            vocabulary='fieldVocabulary',
            widget=SelectionWidget(
                label=_(u'label_savecontentadapter_title',
                        default="Title Field"),