Exemple #1
0
 def color_type(self):
     return enum_type(Color)()
Exemple #2
0
 def color_type(self):
     return enum_type(Color)()
Exemple #3
0
# -*- coding: utf-8 -*-

from __future__ import unicode_literals

import colander

from h import i18n
from h.models.auth_client import GrantType
from h.schemas.base import CSRFSchema, enum_type

_ = i18n.TranslationString
GrantTypeSchemaType = enum_type(GrantType)


class CreateAuthClientSchema(CSRFSchema):
    name = colander.SchemaNode(colander.String(),
                               title=_('Name'),
                               hint=_('This will be displayed to users in the '
                                      'authorization prompt'))

    authority = colander.SchemaNode(colander.String(),
                                    title=_('Authority'),
                                    hint=_(
                                        'Set of users whose data this client '
                                        'can interact with'))

    grant_type = colander.SchemaNode(
        GrantTypeSchemaType(),
        missing=None,
        title=_('Grant type'),
        hint=_(
Exemple #4
0
# -*- coding: utf-8 -*-

from __future__ import unicode_literals

import colander
import deform

from h import i18n
from h.models.auth_client import GrantType
from h.schemas.base import CSRFSchema, enum_type

_ = i18n.TranslationString
GrantTypeSchemaType = enum_type(GrantType)


class CreateAuthClientSchema(CSRFSchema):
    name = colander.SchemaNode(
             colander.String(),
             title=_('Name'),
             hint=_('This will be displayed to users in the '
                    'authorization prompt'))

    authority = colander.SchemaNode(
                  colander.String(),
                  title=_('Authority'),
                  hint=_('Set of users whose data this client '
                         'can interact with'))

    grant_type = colander.SchemaNode(GrantTypeSchemaType(),
                                     missing=None,
                                     title=_('Grant type'),