server/test/data/schema/Societe.py
changeset 0 b97547f5f1fa
child 1802 d628defebc17
equal deleted inserted replaced
-1:000000000000 0:b97547f5f1fa
       
     1 class Societe(EntityType):
       
     2     permissions = {
       
     3         'read': ('managers', 'users', 'guests'),
       
     4         'update': ('managers', 'owners', ERQLExpression('U login L, X nom L')),
       
     5         'delete': ('managers', 'owners', ERQLExpression('U login L, X nom L')),
       
     6         'add': ('managers', 'users',)
       
     7         }
       
     8     
       
     9     nom  = String(maxsize=64, fulltextindexed=True)
       
    10     web  = String(maxsize=128)
       
    11     type  = String(maxsize=128) # attribute in common with Note 
       
    12     tel  = Int()
       
    13     fax  = Int()
       
    14     rncs = String(maxsize=128)
       
    15     ad1  = String(maxsize=128)
       
    16     ad2  = String(maxsize=128)
       
    17     ad3  = String(maxsize=128)
       
    18     cp   = String(maxsize=12)
       
    19     ville= String(maxsize=32)
       
    20 
       
    21 
       
    22 class travaille(RelationType):
       
    23     permissions = {
       
    24         'read':   ('managers', 'users', 'guests'),
       
    25         'add':    ('managers', RRQLExpression('U has_update_permission S')),
       
    26         'delete': ('managers', RRQLExpression('O owned_by U')),
       
    27         }
       
    28 
       
    29 
       
    30 class Division(Societe):
       
    31     __specializes_schema__ = True
       
    32 
       
    33 class SubDivision(Division):
       
    34     __specializes_schema__ = True
       
    35     travaille_subdivision = ObjectRelation('Personne')