class CommentNewForm(formencode.Schema): allow_extra_fields = True topic = forms.ValidDelegateable() reply = forms.ValidComment(if_empty=None, if_missing=None) wiki = validators.StringBool(not_empty=False, if_empty=False, if_missing=False) variant = forms.VariantName(not_empty=False, if_empty=model.Text.HEAD, if_missing=model.Text.HEAD)
def delegations(self, id, format='html'): c.page_user = get_entity_or_abort(model.User, id, instance_filter=False) require.user.show(c.page_user) scope_id = request.params.get('scope', None) if format == 'json': delegations = model.Delegation.find_by_principal(c.page_user) scope = model.Delegateable.find(scope_id) if scope_id else None if scope is not None: delegations = [d for d in delegations if d.is_match(scope)] delegations_pager = pager.delegations(delegations) return render_json(delegations_pager) c.dgbs = [] if scope_id: c.scope = forms.ValidDelegateable().to_python(scope_id) c.dgbs = [c.scope] + c.scope.children else: c.dgbs = model.Delegateable.all(instance=c.instance) c.nodeClass = democracy.DelegationNode self._common_metadata(c.page_user, member='delegations') return render("/user/delegations.html")
class TaggingAllDeleteForm(formencode.Schema): allow_extra_fields = True tag = forms.ValidTag() delegateable = forms.ValidDelegateable()
class TaggingCreateForm(formencode.Schema): allow_extra_fields = True tags = validators.String(max=10000, not_empty=True) delegateable = forms.ValidDelegateable()
class DelegationNewForm(Schema): allow_extra_fields = True scope = forms.ValidDelegateable()