test/data/rqlexpr_on_computedrel.py
author Julien Cristau <julien.cristau@logilab.fr>
Thu, 17 Dec 2015 15:16:14 +0100
changeset 10993 ca656b431267
parent 10554 c39749d14c53
child 10907 9ae707db5265
permissions -rw-r--r--
Added tag debian/3.21.5-2 for changeset 228b6d2777e4

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'),)}