def bind_test5(self, ctx): return annotate.MethodBinding( 'test5', annotate.Method(arguments=[ annotate.Argument('foo', annotate.String()), annotate.Argument('bar', annotate.Integer()) ]))
class FormPage(rend.Page): bind_test1 = defer.succeed([('foo', annotate.String()), ('bar', annotate.Integer())]) bind_test2 = defer.succeed( annotate.MethodBinding( 'test2', annotate.Method(arguments=[ annotate.Argument('foo', annotate.String()) ]))) bind_test3 = defer.succeed( annotate.Property('test3', annotate.Integer())) def bind_test4(self, ctx): return defer.succeed([('foo', annotate.String()), ('bar', annotate.Integer())]) def bind_test5(self, ctx): return defer.succeed( annotate.MethodBinding( 'test5', annotate.Method(arguments=[ annotate.Argument('foo', annotate.String()), annotate.Argument('bar', annotate.Integer()) ]))) docFactory = loaders.stan(html[freeform.renderForms()])
def _convert_list(binding): if isinstance(binding, list): binding = annotate.MethodBinding( name, annotate.Method(arguments=[ annotate.Argument(n, v, v.id) for (n, v) in binding])) return binding
def bind_delete(self, ctx): return annotate.MethodBinding( 'delete', annotate.Method(arguments=[ annotate.Argument('ctx', annotate.Context()), ], label=_('Confirm delete')), action=_('Delete'))
def _bind(ctx): return annotate.MethodBinding('action_' + name, annotate.Method(arguments=[ annotate.Argument(*field) for field in fields ], label=desc), action=btnlabel)
def bind_remove(self, ctx): return annotate.MethodBinding('remove', annotate.Method(arguments=[ annotate.Argument( 'ctx', annotate.Context()), ], label=_('Remove')), action=_('Remove'))
def bind_generateRandom(self, ctx): return annotate.MethodBinding( 'generateRandom', annotate.Method(arguments=[ annotate.Argument('ctx', annotate.Context()), ], label=_('Generate random')), action=_('Generate random'))
def bind_cancel(self, ctx): return annotate.MethodBinding( 'cancel', annotate.Method(arguments=[ annotate.Argument('context', annotate.Context()), ], label=_('Cancel')), action=_('Cancel'))
def bind_animals(self, ctx, ): """Add Animal""" return annotate.MethodBinding( 'animals', annotate.Method(arguments= [annotate.Argument('animal', annotate.String()), annotate.Argument('description', annotate.Text())]), action="Add Animal", )
def bind_add(self, ctx): return annotate.MethodBinding( 'add', annotate.Method(arguments=[ annotate.Argument('context', annotate.Context()), annotate.Argument('smartObjectClass', annotate.Choice(choices=self.plugins)), ], label=_('Add')), action=_('Add'))
def bind_go(self, ctx): return annotate.MethodBinding( 'go', annotate.Method(arguments=[ annotate.Argument('ctx', annotate.Context()), annotate.Argument( 'baseDN', LDAPDN(label=_('Base DN'), description=_( "The top-level LDAP DN you want" " to browse, e.g. dc=example,dc=com"))), ], label=_('Go')), action=_('Go'))
def bind_setServicePassword(self, ctx): return annotate.MethodBinding( 'setServicePassword', annotate.Method(arguments=[ annotate.Argument('ctx', annotate.Context()), annotate.Argument( 'newPassword', annotate.PasswordEntry(required=True, label=_('New password'))), annotate.Argument( 'again', annotate.PasswordEntry(required=True, label=_('Again'))), ], label=_('Set password')), action=_('Set password'))
def bind_add(self, ctx): return annotate.MethodBinding( 'add', annotate.Method(arguments=[ annotate.Argument('ctx', annotate.Context()), annotate.Argument( 'serviceName', annotate.String(required=True, label=_('Service name'))), annotate.Argument( 'newPassword', annotate.PasswordEntry( required=False, label=_('New password'), description=_( "Leave empty to generate random password."))), annotate.Argument( 'again', annotate.PasswordEntry(required=False, label=_('Again'))), ], label=_('Add')), action=_('Add'))
def bind_search(self, ctx): l = [] l.append(annotate.Argument('ctx', annotate.Context())) for field in config.getSearchFieldNames(): l.append(annotate.Argument('search_%s' % field, annotate.String(label=field))) l.append(annotate.Argument('searchfilter', annotate.String(label=_("Advanced search")))) l.append(annotate.Argument( 'scope', annotate.Choice(label=_("Search depth"), choices=[ pureldap.LDAP_SCOPE_wholeSubtree, pureldap.LDAP_SCOPE_singleLevel, pureldap.LDAP_SCOPE_baseObject, ], stringify=strScope, default=pureldap.LDAP_SCOPE_wholeSubtree))) return annotate.MethodBinding( name='search', action=_("Search"), typeValue=annotate.Method(arguments=l, label=_('Search')))
def bind_generate(self, ctx): return annotate.MethodBinding('generatePasswords', annotate.Method( arguments=self.formFields, label=_('Generate passwords')), action=_('Generate passwords'))
def bind_form(self, ctx): return annotate.MethodBinding( 'action', annotate.Method(arguments=self.formElements))
def bind_add(self, ctx): return annotate.MethodBinding('add', annotate.Method( arguments=self.formFields, label=_('Add')), action=_('Add'))