test/data/rqlexpr_on_computedrel.py
author Julien Cristau <julien.cristau@logilab.fr>
Mon, 05 Oct 2015 14:51:24 +0200
changeset 10766 d730f91251af
parent 10554 c39749d14c53
child 10907 9ae707db5265
permissions -rw-r--r--
[ldapfeed] port to ldap3 python-ldap has no python3 support. XXX I only checked that unittest_ldapfeed passes.

from yams.buildobjs import ComputedRelation, EntityType, RelationDefinition
from cubicweb.schema import RRQLExpression

class Subject(EntityType):
    pass

class Object(EntityType):
    pass

class relation(RelationDefinition):
    subject = 'Subject'
    object = 'Object'

class computed(ComputedRelation):
    rule = 'S relation O'
    __permissions__ = {'read': (RRQLExpression('S is ET'),)}