cubicweb/test/data/rqlexpr_on_computedrel.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 20 Jan 2016 08:26:30 +0100
changeset 11219 0796b6191cea
parent 11057 0b59724cb3f2
permissions -rw-r--r--
[pylint] more work on the pylint support * uniformize usage of ClassDef and simplify related import * don't insert in the ast a python function but an astroid representation of that function * ignore __pkginfo__ file * drop attr-rgx, variable-rgx and argument-rgx, put the name in good-names instead * drop additional-builtins * add cell_call to the list of methods for which we don't want 'abstract-method'

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