user.models.role_mapping
¶
Module Contents¶
Classes¶
Defines a generic role mapping between user and/or group and any |
- 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 )