server/test/data/migrschema/Note.py
author sylvain.thenault@logilab.fr
Tue, 17 Feb 2009 23:43:08 +0100
branchtls-sprint
changeset 724 1ecba333cfb0
parent 0 b97547f5f1fa
child 1802 d628defebc17
permissions -rw-r--r--
should no more be used, drop documentation

class Note(EntityType):
    
    permissions = {'read':   ('managers', 'users', 'guests',),
                   'update': ('managers', 'owners',),
                   'delete': ('managers', ),
                   'add':    ('managers', 
                              ERQLExpression('X ecrit_part PE, U in_group G, '
                                             'PE require_permission P, P name "add_note", '
                                             'P require_group G'),)}
    
    date = Datetime()
    type = String(maxsize=1)
    whatever = Int()
    mydate = Date(default='TODAY')
    para = String(maxsize=512)
    shortpara = String(maxsize=64)
    ecrit_par = SubjectRelation('Personne', constraints=[RQLConstraint('S concerne A, O concerne A')])

class ecrit_par(RelationType):
    permissions = {'read':   ('managers', 'users', 'guests',),
                   'delete': ('managers', ),
                   'add':    ('managers', 
                              RRQLExpression('O require_permission P, P name "add_note", '
                                             'U in_group G, P require_group G'),)
                   }
    inlined = True