user.models.role_mapping
Classes
Defines a generic role mapping between user and/or group and any |
Module Contents
- class user.models.role_mapping.RoleMapping[source]
Bases:
onegov.core.orm.Base
,onegov.core.orm.mixins.ContentMixin
,onegov.core.orm.mixins.TimestampMixin
Defines a generic role mapping between user and/or group and any other model (content).
The model does not define the relationship to the content. Instead, the realtionship should be defined in the content model when needed:
role_mappings = relationship( RoleMapping, primaryjoin=( "and_(" "foreign(RoleMapping.content_id) == cast(MyModel.id, TEXT)," "RoleMapping.content_type == 'my_models'" ")" ), viewonly=True )