server/test/data-schemaserial/schema.py
author Julien Cristau <julien.cristau@logilab.fr>
Fri, 13 Jun 2014 11:00:41 +0200
branchstable
changeset 9923 da09975300aa
parent 8945 ba9e3fbfa5a5
child 9452 5308b3fe03c9
permissions -rw-r--r--
[cwctl] don't prompt for cube options in automatic mode Closes #3984223
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8945
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
     1
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
     2
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
     3
#
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
     4
# This file is part of CubicWeb.
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
     5
#
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
     6
# CubicWeb is free software: you can redistribute it and/or modify it under the
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
     7
# terms of the GNU Lesser General Public License as published by the Free
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
     8
# Software Foundation, either version 2.1 of the License, or (at your option)
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
     9
# any later version.
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    10
#
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    11
# CubicWeb is distributed in the hope that it will be useful, but WITHOUT
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    13
# FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    14
# details.
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    15
#
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    16
# You should have received a copy of the GNU Lesser General Public License along
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    17
# with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    18
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    19
from yams.buildobjs import (EntityType, RelationType, RelationDefinition,
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    20
                            SubjectRelation, RichString, String, Int, Float,
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    21
                            Boolean, Datetime, TZDatetime, Bytes)
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    22
from yams.constraints import SizeConstraint
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    23
from cubicweb.schema import (WorkflowableEntityType,
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    24
                             RQLConstraint, RQLUniqueConstraint,
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    25
                             ERQLExpression, RRQLExpression)
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    26
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    27
from yams.buildobjs import make_type
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    28
BabarTestType = make_type('BabarTestType')
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    29
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    30
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    31
class Affaire(WorkflowableEntityType):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    32
    __permissions__ = {
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    33
        'read':   ('managers',
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    34
                   ERQLExpression('X owned_by U'), ERQLExpression('X concerne S?, S owned_by U')),
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    35
        'add':    ('managers', ERQLExpression('X concerne S, S owned_by U')),
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    36
        'update': ('managers', 'owners', ERQLExpression('X in_state S, S name in ("pitetre", "en cours")')),
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    37
        'delete': ('managers', 'owners', ERQLExpression('X concerne S, S owned_by U')),
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    38
        }
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    39
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    40
    ref = String(fulltextindexed=True, indexed=True,
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    41
                 constraints=[SizeConstraint(16)])
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    42
    sujet = String(fulltextindexed=True,
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    43
                   constraints=[SizeConstraint(256)])
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    44
    descr = RichString(fulltextindexed=True,
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    45
                       description=_('more detailed description'))
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    46
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    47
    duration = Int()
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    48
    invoiced = Float()
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    49
    opt_attr = Bytes()
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    50
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    51
    depends_on = SubjectRelation('Affaire')
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    52
    require_permission = SubjectRelation('CWPermission')
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    53
    concerne = SubjectRelation(('Societe', 'Note'))
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    54
    todo_by = SubjectRelation('Personne', cardinality='?*')
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    55
    documented_by = SubjectRelation('Card')
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    56
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    57
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    58
class Societe(EntityType):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    59
    __unique_together__ = [('nom', 'type', 'cp')]
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    60
    __permissions__ = {
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    61
        'read': ('managers', 'users', 'guests'),
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    62
        'update': ('managers', 'owners', ERQLExpression('U login L, X nom L')),
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    63
        'delete': ('managers', 'owners', ERQLExpression('U login L, X nom L')),
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    64
        'add': ('managers', 'users',)
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    65
        }
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    66
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    67
    nom  = String(maxsize=64, fulltextindexed=True)
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    68
    web  = String(maxsize=128)
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    69
    type  = String(maxsize=128) # attribute in common with Note
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    70
    tel  = Int()
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    71
    fax  = Int()
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    72
    rncs = String(maxsize=128)
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    73
    ad1  = String(maxsize=128)
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    74
    ad2  = String(maxsize=128)
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    75
    ad3  = String(maxsize=128)
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    76
    cp   = String(maxsize=12)
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    77
    ville= String(maxsize=32)
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    78
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    79
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    80
class Division(Societe):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    81
    __specializes_schema__ = True
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    82
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    83
class SubDivision(Division):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    84
    __specializes_schema__ = True
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    85
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    86
class travaille_subdivision(RelationDefinition):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    87
    subject = 'Personne'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    88
    object = 'SubDivision'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    89
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    90
from cubicweb.schemas.base import CWUser
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    91
CWUser.get_relations('login').next().fulltextindexed = True
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    92
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    93
class Note(WorkflowableEntityType):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    94
    date = String(maxsize=10)
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    95
    type = String(maxsize=6)
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    96
    para = String(maxsize=512,
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    97
                  __permissions__ = {
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    98
                      'read':   ('managers', 'users', 'guests'),
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
    99
                      'update': ('managers', ERQLExpression('X in_state S, S name "todo"')),
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   100
                      })
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   101
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   102
    migrated_from = SubjectRelation('Note')
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   103
    attachment = SubjectRelation('File')
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   104
    inline1 = SubjectRelation('Affaire', inlined=True, cardinality='?*',
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   105
                              constraints=[RQLUniqueConstraint('S type T, S inline1 A1, A1 todo_by C, '
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   106
                                                              'Y type T, Y inline1 A2, A2 todo_by C',
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   107
                                                               'S,Y')])
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   108
    todo_by = SubjectRelation('CWUser')
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   109
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   110
class Personne(EntityType):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   111
    __unique_together__ = [('nom', 'prenom', 'inline2')]
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   112
    nom    = String(fulltextindexed=True, required=True, maxsize=64)
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   113
    prenom = String(fulltextindexed=True, maxsize=64)
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   114
    sexe   = String(maxsize=1, default='M', fulltextindexed=True)
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   115
    promo  = String(vocabulary=('bon','pasbon'))
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   116
    titre  = String(fulltextindexed=True, maxsize=128)
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   117
    adel   = String(maxsize=128)
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   118
    ass    = String(maxsize=128)
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   119
    web    = String(maxsize=128)
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   120
    tel    = Int()
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   121
    fax    = Int()
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   122
    datenaiss = Datetime()
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   123
    tzdatenaiss = TZDatetime()
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   124
    test   = Boolean(__permissions__={
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   125
        'read': ('managers', 'users', 'guests'),
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   126
        'update': ('managers',),
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   127
        })
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   128
    description = String()
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   129
    firstname = String(fulltextindexed=True, maxsize=64)
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   130
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   131
    concerne = SubjectRelation('Affaire')
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   132
    connait = SubjectRelation('Personne')
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   133
    inline2 = SubjectRelation('Affaire', inlined=True, cardinality='?*')
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   134
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   135
    custom_field_of_jungle = BabarTestType(jungle_speed=42)
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   136
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   137
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   138
class Old(EntityType):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   139
    name = String()
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   140
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   141
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   142
class connait(RelationType):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   143
    symmetric = True
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   144
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   145
class concerne(RelationType):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   146
    __permissions__ = {
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   147
        'read':   ('managers', 'users', 'guests'),
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   148
        'add':    ('managers', RRQLExpression('U has_update_permission S')),
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   149
        'delete': ('managers', RRQLExpression('O owned_by U')),
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   150
        }
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   151
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   152
class travaille(RelationDefinition):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   153
    __permissions__ = {
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   154
        'read':   ('managers', 'users', 'guests'),
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   155
        'add':    ('managers', RRQLExpression('U has_update_permission S')),
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   156
        'delete': ('managers', RRQLExpression('O owned_by U')),
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   157
        }
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   158
    subject = 'Personne'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   159
    object = 'Societe'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   160
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   161
class comments(RelationDefinition):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   162
    subject = 'Comment'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   163
    object = 'Personne'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   164
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   165
class fiche(RelationDefinition):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   166
    inlined = True
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   167
    subject = 'Personne'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   168
    object = 'Card'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   169
    cardinality = '??'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   170
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   171
class multisource_inlined_rel(RelationDefinition):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   172
    inlined = True
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   173
    cardinality = '?*'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   174
    subject = ('Card', 'Note')
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   175
    object = ('Affaire', 'Note')
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   176
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   177
class multisource_rel(RelationDefinition):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   178
    subject = ('Card', 'Note')
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   179
    object = 'Note'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   180
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   181
class multisource_crossed_rel(RelationDefinition):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   182
    subject = ('Card', 'Note')
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   183
    object = 'Note'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   184
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   185
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   186
class see_also_1(RelationDefinition):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   187
    name = 'see_also'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   188
    subject = object = 'Folder'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   189
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   190
class see_also_2(RelationDefinition):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   191
    name = 'see_also'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   192
    subject = ('Bookmark', 'Note')
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   193
    object = ('Bookmark', 'Note')
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   194
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   195
class evaluee(RelationDefinition):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   196
    subject = ('Personne', 'CWUser', 'Societe')
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   197
    object = ('Note')
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   198
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   199
class ecrit_par(RelationType):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   200
    inlined = True
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   201
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   202
class ecrit_par_1(RelationDefinition):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   203
    name = 'ecrit_par'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   204
    subject = 'Note'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   205
    object ='Personne'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   206
    constraints = [RQLConstraint('E concerns P, S version_of P')]
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   207
    cardinality = '?*'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   208
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   209
class ecrit_par_2(RelationDefinition):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   210
    name = 'ecrit_par'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   211
    subject = 'Note'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   212
    object ='CWUser'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   213
    cardinality='?*'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   214
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   215
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   216
class copain(RelationDefinition):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   217
    subject = object = 'CWUser'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   218
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   219
class tags(RelationDefinition):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   220
    subject = 'Tag'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   221
    object = ('CWUser', 'CWGroup', 'State', 'Note', 'Card', 'Affaire')
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   222
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   223
class filed_under(RelationDefinition):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   224
    subject = ('Note', 'Affaire')
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   225
    object = 'Folder'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   226
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   227
class require_permission(RelationDefinition):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   228
    subject = ('Card', 'Note', 'Personne')
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   229
    object = 'CWPermission'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   230
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   231
class require_state(RelationDefinition):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   232
    subject = 'CWPermission'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   233
    object = 'State'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   234
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   235
class personne_composite(RelationDefinition):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   236
    subject='Personne'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   237
    object='Personne'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   238
    composite='subject'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   239
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   240
class personne_inlined(RelationDefinition):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   241
    subject='Personne'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   242
    object='Personne'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   243
    cardinality='?*'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   244
    inlined=True
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   245
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   246
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   247
class login_user(RelationDefinition):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   248
    subject = 'Personne'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   249
    object = 'CWUser'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   250
    cardinality = '??'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   251
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   252
class ambiguous_inlined(RelationDefinition):
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   253
    subject = ('Affaire', 'Note')
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   254
    object = 'CWUser'
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   255
    inlined = True
ba9e3fbfa5a5 [schemaserial] serialize additional yams parameter for customs type
Vincent Michel <vincent.michel@logilab.fr>
parents:
diff changeset
   256
    cardinality = '?*'