예제 #1
0
파일: link.py 프로젝트: Kotti/kotti_actions
class LinkActionSchema(DocumentSchema):

    link = colander.SchemaNode(
        colander.String(),
        title=_('Link'),
        validator=link_validator,
        missing=u'',
        )
    target = colander.SchemaNode(
        colander.String(),
        title=_('Target'),
        widget=SelectWidget(values=[('', ''), ('_blank', '_blank')]),
        missing=u'',
        )

    def after_bind(self, node, kw):
        del node['body']
        del node['tags']
예제 #2
0
 def raise_invalid_url(node, value):
     raise colander.Invalid(
         node, _(u"You must provide a valid url or email."))
예제 #3
0
class FooterActionManagerAddForm(AddFormView):
    """ Form to add a new instance of ActionManager. """

    schema_factory = FooterActionManagerSchema
    add = FooterActionManager
    item_type = _(u"FooterActionManager")
예제 #4
0
class NavigationActionManagerAddForm(AddFormView):
    """ Form to add a new instance of ActionManager. """

    schema_factory = NavigationActionManagerSchema
    add = NavigationActionManager
    item_type = _(u"NavigationActionManager")
예제 #5
0
 def after_bind(self, node, kw):
     super(FooterActionManagerSchema, self).after_bind(node, kw)
     node['title'].default = _('FooterActionManager')
예제 #6
0
 def after_bind(self, node, kw):
     super(NavigationActionManagerSchema, self).after_bind(node, kw)
     node['title'].default = _('NavigationActionManager')
예제 #7
0
파일: link.py 프로젝트: Kotti/kotti_actions
class LinkActionAddForm(DocumentAddForm):
    item_type = _(u"Link Action")
    add = LinkAction
    schema_factory = LinkActionSchema