Example #1
0
        }
    },
    'is_enabled': {
        'type': colander.Bool(),
        'title': "Enabled?",
        'widget': None,
        'colModel': {
            'width': 50,
            'editable': True,
            'edittype': 'checkbox',
            'editoptions': {'value': "true:false"},
            'formoptions': {'elmprefix': None}
        }
    }
}
apply_mixin(DomainDd, DefaultMixinDd)


class Domain(DbBase, DefaultMixin):
    """
    Domain.
    """
    __tablename__ = "vmail_domain"
    __table_args__ = (
        sa.UniqueConstraint('name'),
    )

    FIND_ONE_FIELD = 'name'

    name = sa.Column(sa.Unicode(100), nullable=False, index=True)
    """
Example #2
0
            'width': 50
            , 'editable': True
        }
    }
    , 'principal_id': {
        'type': colander.Int()
        , 'title': 'PrincipalId'
        , 'widget': None
        , 'validator': colander.Length(min=1)
        , 'colModel': {
            'width': 50
            , 'editable': True
        }
    }
}
apply_mixin(RoleMemberDd, DefaultMixinDd)


class RoleMember(DbBase, DefaultMixin):
    __tablename__ = "rolemember"
    __table_args__ = (
        sa.UniqueConstraint('role_id', 'principal_id'),
        {
            #'schema': 'pym'
        }
    )

    principal_id = sa.Column(sa.BigInteger,
            sa.ForeignKey("principal.id", onupdate="CASCADE", ondelete="CASCADE"),
            nullable=False)
    role_id = sa.Column(sa.BigInteger,