Exemplo n.º 1
0
class GhostFolderEditForm(silvaforms.SMIEditForm):
    """ Edit form Ghost Folder
    """
    grok.context(IGhostFolder)
    grok.name('edit')

    fields = silvaforms.Fields(IGhostFolderSchema).omit('id')
    dataValidators = [TargetValidator('haunted', IContainer, adding=False)]
    actions = silvaforms.SMIEditForm.actions + SyncAction(_('Synchronize'))
Exemplo n.º 2
0
class GhostAssetEditForm(silvaforms.SMISubForm):
    """ Edit form Ghost Folder
    """
    grok.context(IGhostAsset)
    grok.view(AssetEditTab)
    grok.order(10)

    label = _(u'Edit ghost')
    ignoreContent = False
    dataManager = silvaforms.SilvaDataManager
    dataValidators = [TargetValidator('haunted', IAsset, adding=False)]
    fields = silvaforms.Fields(IGhostAssetSchema).omit('id')
    actions = silvaforms.Actions(silvaforms.CancelEditAction(),
                                 silvaforms.EditAction())
Exemplo n.º 3
0
class GhostAssetAddForm(silvaforms.SMIAddForm):
    """ Add form for ghost folders
    """
    grok.name(u'Silva Ghost Asset')

    fields = silvaforms.Fields(IGhostAssetSchema)
    fields['haunted'].referenceNotSetLabel = _(
        u"Click the Lookup button to select an asset to haunt.")
    dataValidators = [TargetValidator('haunted', IAsset, adding=True)]

    def _add(self, parent, data):
        factory = parent.manage_addProduct['Silva']
        return factory.manage_addGhostAsset(data['id'],
                                            None,
                                            haunted=data['haunted'])