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']
def raise_invalid_url(node, value): raise colander.Invalid( node, _(u"You must provide a valid url or email."))
class FooterActionManagerAddForm(AddFormView): """ Form to add a new instance of ActionManager. """ schema_factory = FooterActionManagerSchema add = FooterActionManager item_type = _(u"FooterActionManager")
class NavigationActionManagerAddForm(AddFormView): """ Form to add a new instance of ActionManager. """ schema_factory = NavigationActionManagerSchema add = NavigationActionManager item_type = _(u"NavigationActionManager")
def after_bind(self, node, kw): super(FooterActionManagerSchema, self).after_bind(node, kw) node['title'].default = _('FooterActionManager')
def after_bind(self, node, kw): super(NavigationActionManagerSchema, self).after_bind(node, kw) node['title'].default = _('NavigationActionManager')
class LinkActionAddForm(DocumentAddForm): item_type = _(u"Link Action") add = LinkAction schema_factory = LinkActionSchema