cubicweb/test/data/rqlexpr_on_computedrel.py
author Laurent Peuch <cortex@worlddomination.be>
Tue, 17 Dec 2019 17:19:15 +0100
changeset 12821 fce106b9977d
parent 11057 0b59724cb3f2
permissions -rw-r--r--
[test/fix] tempfile is non portable linux command and is useless here Closes #17260390

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