test/data/rqlexpr_on_computedrel.py
author Julien Cristau <julien.cristau@logilab.fr>
Tue, 28 Jul 2015 18:57:21 +0200
changeset 10559 5821ae654dfd
parent 10554 c39749d14c53
child 10907 9ae707db5265
permissions -rw-r--r--
[pkg] various debian packaging fixes - stop using *.install.in files, just use wildcards in *.install - switch to X-Python-Version (preferred for dh_python2) - also call dh_python2 for /usr/share/cubicweb, not just public modules - drop long obsolete ginco and erudi migration code from cubicweb-ctl.postinst - fix cubicweb-ctl cleanup: purge code belongs in postrm, not prerm - don't compress changelog.html

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