author | Alexandre Fayolle <alexandre.fayolle@logilab.fr> |
Fri, 10 Sep 2010 16:48:58 +0200 | |
branch | stable |
changeset 6208 | 07b176640a8c |
parent 5762 | 730d458ec1bf |
child 6225 | a176e68b7d0d |
child 6236 | 9138f23ee263 |
permissions | -rw-r--r-- |
5421
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
1 |
# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
2 |
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
3 |
# |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
4 |
# This file is part of CubicWeb. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
5 |
# |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
6 |
# CubicWeb is free software: you can redistribute it and/or modify it under the |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
7 |
# terms of the GNU Lesser General Public License as published by the Free |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
8 |
# Software Foundation, either version 2.1 of the License, or (at your option) |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
9 |
# any later version. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
10 |
# |
5424
8ecbcbff9777
replace logilab-common by CubicWeb in disclaimer
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5421
diff
changeset
|
11 |
# CubicWeb is distributed in the hope that it will be useful, but WITHOUT |
5421
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
13 |
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
14 |
# details. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
15 |
# |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
16 |
# You should have received a copy of the GNU Lesser General Public License along |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
17 |
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
18 |
|
2503
c4bf7ef8b851
explicit imports
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2459
diff
changeset
|
19 |
from yams.buildobjs import (EntityType, RelationType, RelationDefinition, |
5386
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
20 |
SubjectRelation, RichString, String, Int, Boolean, Datetime) |
2503
c4bf7ef8b851
explicit imports
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2459
diff
changeset
|
21 |
from yams.constraints import SizeConstraint |
c4bf7ef8b851
explicit imports
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2459
diff
changeset
|
22 |
from cubicweb.schema import (WorkflowableEntityType, RQLConstraint, |
c4bf7ef8b851
explicit imports
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2459
diff
changeset
|
23 |
ERQLExpression, RRQLExpression) |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
24 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
25 |
class Affaire(WorkflowableEntityType): |
3877
7ca53fc72a0a
reldefsecurity branch :
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3546
diff
changeset
|
26 |
__permissions__ = { |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
27 |
'read': ('managers', |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
28 |
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
|
29 |
'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
|
30 |
'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
|
31 |
'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
|
32 |
} |
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 |
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
|
35 |
constraints=[SizeConstraint(16)]) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
36 |
sujet = String(fulltextindexed=True, |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
37 |
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
|
38 |
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
|
39 |
description=_('more detailed description')) |
2349
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 |
duration = Int() |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
42 |
invoiced = Int() |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
43 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
44 |
depends_on = SubjectRelation('Affaire') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
45 |
require_permission = SubjectRelation('CWPermission') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
46 |
concerne = SubjectRelation(('Societe', 'Note')) |
2923
b97a0f8dd4dc
fix test schema and update some tests to work again with wf changes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2920
diff
changeset
|
47 |
todo_by = SubjectRelation('Personne', cardinality='?*') |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
48 |
documented_by = SubjectRelation('Card') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
49 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
50 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
51 |
class Societe(EntityType): |
3877
7ca53fc72a0a
reldefsecurity branch :
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3546
diff
changeset
|
52 |
__permissions__ = { |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
53 |
'read': ('managers', 'users', 'guests'), |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
54 |
'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
|
55 |
'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
|
56 |
'add': ('managers', 'users',) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
57 |
} |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
58 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
59 |
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
|
60 |
web = String(maxsize=128) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
61 |
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
|
62 |
tel = Int() |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
63 |
fax = Int() |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
64 |
rncs = String(maxsize=128) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
65 |
ad1 = String(maxsize=128) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
66 |
ad2 = String(maxsize=128) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
67 |
ad3 = String(maxsize=128) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
68 |
cp = String(maxsize=12) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
69 |
ville= String(maxsize=32) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
70 |
|
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 Division(Societe): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
73 |
__specializes_schema__ = True |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
74 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
75 |
class SubDivision(Division): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
76 |
__specializes_schema__ = True |
5386
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
77 |
|
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
78 |
class travaille_subdivision(RelationDefinition): |
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
79 |
subject = 'Personne' |
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
80 |
object = 'SubDivision' |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
81 |
|
2455
5346d9f3d5ec
[tests] fixes (including two operations renaming)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
2349
diff
changeset
|
82 |
from cubicweb.schemas.base import CWUser |
5346d9f3d5ec
[tests] fixes (including two operations renaming)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
2349
diff
changeset
|
83 |
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
|
84 |
|
2920
64322aa83a1d
start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2608
diff
changeset
|
85 |
class Note(WorkflowableEntityType): |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
86 |
date = String(maxsize=10) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
87 |
type = String(maxsize=6) |
5386
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
88 |
para = String(maxsize=512, |
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
89 |
__permissions__ = { |
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
90 |
'read': ('managers', 'users', 'guests'), |
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
91 |
'update': ('managers', ERQLExpression('X in_state S, S name "todo"')), |
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
92 |
}) |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
93 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
94 |
migrated_from = SubjectRelation('Note') |
5575
8a531340c3ef
no more Image type w/ cw 3.9
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5426
diff
changeset
|
95 |
attachment = SubjectRelation('File') |
2608
21856eda34f6
[F repo tests] tests have to be updated:
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2503
diff
changeset
|
96 |
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
|
97 |
todo_by = SubjectRelation('CWUser') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
98 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
99 |
class Personne(EntityType): |
6208
07b176640a8c
unique_together integration in CW (alf+syt)
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents:
5762
diff
changeset
|
100 |
__unique_together__ = [('nom', 'prenom', 'inline2')] |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
101 |
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
|
102 |
prenom = String(fulltextindexed=True, maxsize=64) |
3546
f0aecddf367e
fix bug when renaming a full text indexed attribute
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2923
diff
changeset
|
103 |
sexe = String(maxsize=1, default='M', fulltextindexed=True) |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
104 |
promo = String(vocabulary=('bon','pasbon')) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
105 |
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
|
106 |
adel = String(maxsize=128) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
107 |
ass = String(maxsize=128) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
108 |
web = String(maxsize=128) |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
109 |
tel = Int() |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
110 |
fax = Int() |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
111 |
datenaiss = Datetime() |
5386
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
112 |
test = Boolean(__permissions__={ |
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
113 |
'read': ('managers', 'users', 'guests'), |
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
114 |
'update': ('managers',), |
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
115 |
}) |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
116 |
description = String() |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
117 |
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
|
118 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
119 |
concerne = SubjectRelation('Affaire') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
120 |
connait = SubjectRelation('Personne') |
2608
21856eda34f6
[F repo tests] tests have to be updated:
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2503
diff
changeset
|
121 |
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
|
122 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
123 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
124 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
125 |
class connait(RelationType): |
4467
0e73d299730a
fix long-waiting symetric typo: should be spelled symmetric. Add auto database migration on schema deserialization
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
126 |
symmetric = True |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
127 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
128 |
class concerne(RelationType): |
3877
7ca53fc72a0a
reldefsecurity branch :
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3546
diff
changeset
|
129 |
__permissions__ = { |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
130 |
'read': ('managers', 'users', 'guests'), |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
131 |
'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
|
132 |
'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
|
133 |
} |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
134 |
|
5386
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
135 |
class travaille(RelationDefinition): |
3877
7ca53fc72a0a
reldefsecurity branch :
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3546
diff
changeset
|
136 |
__permissions__ = { |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
137 |
'read': ('managers', 'users', 'guests'), |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
138 |
'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
|
139 |
'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
|
140 |
} |
5386
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
141 |
subject = 'Personne' |
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
142 |
object = 'Societe' |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
143 |
|
5386
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
144 |
class comments(RelationDefinition): |
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
145 |
subject = 'Comment' |
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
146 |
object = 'Personne' |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
147 |
|
5386
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
148 |
class fiche(RelationDefinition): |
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
149 |
inlined = True |
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
150 |
subject = 'Personne' |
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
151 |
object = 'Card' |
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
152 |
cardinality = '??' |
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
153 |
|
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
154 |
class multisource_inlined_rel(RelationDefinition): |
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
155 |
inlined = True |
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
156 |
cardinality = '?*' |
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
157 |
subject = ('Card', 'Note') |
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
158 |
object = ('Affaire', 'Note') |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
159 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
160 |
class multisource_rel(RelationDefinition): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
161 |
subject = ('Card', 'Note') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
162 |
object = 'Note' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
163 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
164 |
class multisource_crossed_rel(RelationDefinition): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
165 |
subject = ('Card', 'Note') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
166 |
object = 'Note' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
167 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
168 |
|
2608
21856eda34f6
[F repo tests] tests have to be updated:
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2503
diff
changeset
|
169 |
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
|
170 |
name = 'see_also' |
21856eda34f6
[F repo tests] tests have to be updated:
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2503
diff
changeset
|
171 |
subject = object = 'Folder' |
21856eda34f6
[F repo tests] tests have to be updated:
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2503
diff
changeset
|
172 |
|
21856eda34f6
[F repo tests] tests have to be updated:
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2503
diff
changeset
|
173 |
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
|
174 |
name = 'see_also' |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
175 |
subject = ('Bookmark', 'Note') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
176 |
object = ('Bookmark', 'Note') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
177 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
178 |
class evaluee(RelationDefinition): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
179 |
subject = ('Personne', 'CWUser', 'Societe') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
180 |
object = ('Note') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
181 |
|
5386
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
182 |
class ecrit_par(RelationType): |
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
183 |
inlined = True |
4c92202ab130
[test] stop using ObjectRelation in schema
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4635
diff
changeset
|
184 |
|
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
185 |
class ecrit_par_1(RelationDefinition): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
186 |
name = 'ecrit_par' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
187 |
subject = 'Note' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
188 |
object ='Personne' |
3981
8029019884af
this invalid constraint now fails with new constraints checking
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3546
diff
changeset
|
189 |
constraints = [RQLConstraint('E concerns P, S version_of P')] |
2608
21856eda34f6
[F repo tests] tests have to be updated:
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2503
diff
changeset
|
190 |
cardinality = '?*' |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
191 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
192 |
class ecrit_par_2(RelationDefinition): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
193 |
name = 'ecrit_par' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
194 |
subject = 'Note' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
195 |
object ='CWUser' |
2608
21856eda34f6
[F repo tests] tests have to be updated:
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2503
diff
changeset
|
196 |
cardinality='?*' |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
197 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
198 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
199 |
class copain(RelationDefinition): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
200 |
subject = object = 'CWUser' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
201 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
202 |
class tags(RelationDefinition): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
203 |
subject = 'Tag' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
204 |
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
|
205 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
206 |
class filed_under(RelationDefinition): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
207 |
subject = ('Note', 'Affaire') |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
208 |
object = 'Folder' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
209 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
210 |
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
|
211 |
subject = ('Card', 'Note', 'Personne') |
2349
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
212 |
object = 'CWPermission' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
213 |
|
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
214 |
class require_state(RelationDefinition): |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
215 |
subject = 'CWPermission' |
b9e2c1b7b873
rewrite test schema using a single schema file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff
changeset
|
216 |
object = 'State' |