author | Adrien Di Mascio <Adrien.DiMascio@logilab.fr> |
Sun, 16 Aug 2009 20:41:06 +0200 | |
branch | stable |
changeset 2868 | 937890e25765 |
parent 2608 | 21856eda34f6 |
child 2920 | 64322aa83a1d |
permissions | -rw-r--r-- |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
1 |
""" |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
2 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
3 |
:organization: Logilab |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
4 |
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2. |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
5 |
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
6 |
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
7 |
""" |
2503
c4bf7ef8b851
explicit imports
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2459
diff
changeset
|
8 |
from yams.buildobjs import (EntityType, RelationType, RelationDefinition, |
c4bf7ef8b851
explicit imports
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2459
diff
changeset
|
9 |
SubjectRelation, ObjectRelation, |
c4bf7ef8b851
explicit imports
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2459
diff
changeset
|
10 |
RichString, String, Int, Boolean, Datetime) |
c4bf7ef8b851
explicit imports
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2459
diff
changeset
|
11 |
from yams.constraints import SizeConstraint |
c4bf7ef8b851
explicit imports
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2459
diff
changeset
|
12 |
from cubicweb.schema import (WorkflowableEntityType, RQLConstraint, |
c4bf7ef8b851
explicit imports
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2459
diff
changeset
|
13 |
ERQLExpression, RRQLExpression) |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
14 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
15 |
class Affaire(WorkflowableEntityType): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
16 |
permissions = { |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
17 |
'read': ('managers', |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
18 |
ERQLExpression('X owned_by U'), ERQLExpression('X concerne S?, S owned_by U')), |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
19 |
'add': ('managers', ERQLExpression('X concerne S, S owned_by U')), |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
20 |
'update': ('managers', 'owners', ERQLExpression('X in_state S, S name in ("pitetre", "en cours")')), |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
21 |
'delete': ('managers', 'owners', ERQLExpression('X concerne S, S owned_by U')), |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
22 |
} |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
23 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
24 |
ref = String(fulltextindexed=True, indexed=True, |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
25 |
constraints=[SizeConstraint(16)]) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
26 |
sujet = String(fulltextindexed=True, |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
27 |
constraints=[SizeConstraint(256)]) |
2459
d088d0ff48a1
move RichString and co to yams, keeping only a small monkeypatch for cw-page-template here
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2455
diff
changeset
|
28 |
descr = RichString(fulltextindexed=True, |
d088d0ff48a1
move RichString and co to yams, keeping only a small monkeypatch for cw-page-template here
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2455
diff
changeset
|
29 |
description=_('more detailed description')) |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
30 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
31 |
duration = Int() |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
32 |
invoiced = Int() |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
33 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
34 |
depends_on = SubjectRelation('Affaire') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
35 |
require_permission = SubjectRelation('CWPermission') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
36 |
concerne = SubjectRelation(('Societe', 'Note')) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
37 |
todo_by = SubjectRelation('Personne') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
38 |
documented_by = SubjectRelation('Card') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
39 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
40 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
41 |
class Societe(EntityType): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
42 |
permissions = { |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
43 |
'read': ('managers', 'users', 'guests'), |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
44 |
'update': ('managers', 'owners', ERQLExpression('U login L, X nom L')), |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
45 |
'delete': ('managers', 'owners', ERQLExpression('U login L, X nom L')), |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
46 |
'add': ('managers', 'users',) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
47 |
} |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
48 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
49 |
nom = String(maxsize=64, fulltextindexed=True) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
50 |
web = String(maxsize=128) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
51 |
type = String(maxsize=128) # attribute in common with Note |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
52 |
tel = Int() |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
53 |
fax = Int() |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
54 |
rncs = String(maxsize=128) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
55 |
ad1 = String(maxsize=128) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
56 |
ad2 = String(maxsize=128) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
57 |
ad3 = String(maxsize=128) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
58 |
cp = String(maxsize=12) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
59 |
ville= String(maxsize=32) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
60 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
61 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
62 |
class Division(Societe): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
63 |
__specializes_schema__ = True |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
64 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
65 |
class SubDivision(Division): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
66 |
__specializes_schema__ = True |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
67 |
travaille_subdivision = ObjectRelation('Personne') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
68 |
|
2455
5346d9f3d5ec
[tests] fixes (including two operations renaming)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
2349
diff
changeset
|
69 |
from cubicweb.schemas.base import CWUser |
5346d9f3d5ec
[tests] fixes (including two operations renaming)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
2349
diff
changeset
|
70 |
CWUser.get_relations('login').next().fulltextindexed = True |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
71 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
72 |
class Note(EntityType): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
73 |
date = String(maxsize=10) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
74 |
type = String(maxsize=6) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
75 |
para = String(maxsize=512) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
76 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
77 |
migrated_from = SubjectRelation('Note') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
78 |
attachment = SubjectRelation(('File', 'Image')) |
2608
21856eda34f6
[F repo tests] tests have to be updated:
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2503
diff
changeset
|
79 |
inline1 = SubjectRelation('Affaire', inlined=True, cardinality='?*') |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
80 |
todo_by = SubjectRelation('CWUser') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
81 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
82 |
class Personne(EntityType): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
83 |
nom = String(fulltextindexed=True, required=True, maxsize=64) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
84 |
prenom = String(fulltextindexed=True, maxsize=64) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
85 |
sexe = String(maxsize=1, default='M') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
86 |
promo = String(vocabulary=('bon','pasbon')) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
87 |
titre = String(fulltextindexed=True, maxsize=128) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
88 |
adel = String(maxsize=128) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
89 |
ass = String(maxsize=128) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
90 |
web = String(maxsize=128) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
91 |
tel = Int() |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
92 |
fax = Int() |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
93 |
datenaiss = Datetime() |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
94 |
test = Boolean() |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
95 |
description = String() |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
96 |
firstname = String(fulltextindexed=True, maxsize=64) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
97 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
98 |
travaille = SubjectRelation('Societe') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
99 |
concerne = SubjectRelation('Affaire') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
100 |
connait = SubjectRelation('Personne') |
2608
21856eda34f6
[F repo tests] tests have to be updated:
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2503
diff
changeset
|
101 |
inline2 = SubjectRelation('Affaire', inlined=True, cardinality='?*') |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
102 |
comments = ObjectRelation('Comment') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
103 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
104 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
105 |
class fiche(RelationType): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
106 |
inlined = True |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
107 |
subject = 'Personne' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
108 |
object = 'Card' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
109 |
cardinality = '??' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
110 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
111 |
class multisource_inlined_rel(RelationType): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
112 |
inlined = True |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
113 |
cardinality = '?*' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
114 |
subject = ('Card', 'Note') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
115 |
object = ('Affaire', 'Note') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
116 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
117 |
class ecrit_par(RelationType): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
118 |
inlined = True |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
119 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
120 |
class connait(RelationType): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
121 |
symetric = True |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
122 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
123 |
class concerne(RelationType): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
124 |
permissions = { |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
125 |
'read': ('managers', 'users', 'guests'), |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
126 |
'add': ('managers', RRQLExpression('U has_update_permission S')), |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
127 |
'delete': ('managers', RRQLExpression('O owned_by U')), |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
128 |
} |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
129 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
130 |
class travaille(RelationType): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
131 |
permissions = { |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
132 |
'read': ('managers', 'users', 'guests'), |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
133 |
'add': ('managers', RRQLExpression('U has_update_permission S')), |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
134 |
'delete': ('managers', RRQLExpression('O owned_by U')), |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
135 |
} |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
136 |
|
2455
5346d9f3d5ec
[tests] fixes (including two operations renaming)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
2349
diff
changeset
|
137 |
class para(RelationType): |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
138 |
permissions = { |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
139 |
'read': ('managers', 'users', 'guests'), |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
140 |
'add': ('managers', ERQLExpression('X in_state S, S name "todo"')), |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
141 |
'delete': ('managers', ERQLExpression('X in_state S, S name "todo"')), |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
142 |
} |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
143 |
|
2455
5346d9f3d5ec
[tests] fixes (including two operations renaming)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
2349
diff
changeset
|
144 |
class test(RelationType): |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
145 |
permissions = {'read': ('managers', 'users', 'guests'), |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
146 |
'delete': ('managers',), |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
147 |
'add': ('managers',)} |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
148 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
149 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
150 |
class in_state(RelationDefinition): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
151 |
subject = 'Note' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
152 |
object = 'State' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
153 |
cardinality = '1*' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
154 |
constraints=[RQLConstraint('S is ET, O state_of ET')] |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
155 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
156 |
class wf_info_for(RelationDefinition): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
157 |
subject = 'TrInfo' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
158 |
object = 'Note' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
159 |
cardinality = '1*' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
160 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
161 |
class multisource_rel(RelationDefinition): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
162 |
subject = ('Card', 'Note') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
163 |
object = 'Note' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
164 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
165 |
class multisource_crossed_rel(RelationDefinition): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
166 |
subject = ('Card', 'Note') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
167 |
object = 'Note' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
168 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
169 |
|
2608
21856eda34f6
[F repo tests] tests have to be updated:
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2503
diff
changeset
|
170 |
class see_also_1(RelationDefinition): |
21856eda34f6
[F repo tests] tests have to be updated:
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2503
diff
changeset
|
171 |
name = 'see_also' |
21856eda34f6
[F repo tests] tests have to be updated:
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2503
diff
changeset
|
172 |
subject = object = 'Folder' |
21856eda34f6
[F repo tests] tests have to be updated:
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2503
diff
changeset
|
173 |
|
21856eda34f6
[F repo tests] tests have to be updated:
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2503
diff
changeset
|
174 |
class see_also_2(RelationDefinition): |
21856eda34f6
[F repo tests] tests have to be updated:
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2503
diff
changeset
|
175 |
name = 'see_also' |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
176 |
subject = ('Bookmark', 'Note') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
177 |
object = ('Bookmark', 'Note') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
178 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
179 |
class evaluee(RelationDefinition): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
180 |
subject = ('Personne', 'CWUser', 'Societe') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
181 |
object = ('Note') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
182 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
183 |
class ecrit_par_1(RelationDefinition): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
184 |
name = 'ecrit_par' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
185 |
subject = 'Note' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
186 |
object ='Personne' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
187 |
constraints = [RQLConstraint('E concerns P, X version_of P')] |
2608
21856eda34f6
[F repo tests] tests have to be updated:
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2503
diff
changeset
|
188 |
cardinality = '?*' |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
189 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
190 |
class ecrit_par_2(RelationDefinition): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
191 |
name = 'ecrit_par' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
192 |
subject = 'Note' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
193 |
object ='CWUser' |
2608
21856eda34f6
[F repo tests] tests have to be updated:
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2503
diff
changeset
|
194 |
cardinality='?*' |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
195 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
196 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
197 |
class copain(RelationDefinition): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
198 |
subject = object = 'CWUser' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
199 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
200 |
class tags(RelationDefinition): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
201 |
subject = 'Tag' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
202 |
object = ('CWUser', 'CWGroup', 'State', 'Note', 'Card', 'Affaire') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
203 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
204 |
class filed_under(RelationDefinition): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
205 |
subject = ('Note', 'Affaire') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
206 |
object = 'Folder' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
207 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
208 |
class require_permission(RelationDefinition): |
2608
21856eda34f6
[F repo tests] tests have to be updated:
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2503
diff
changeset
|
209 |
subject = ('Card', 'Note', 'Personne') |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
210 |
object = 'CWPermission' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
211 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
212 |
class require_state(RelationDefinition): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
213 |
subject = 'CWPermission' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
214 |
object = 'State' |