server/test/data/schema/custom.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 10 Jun 2009 18:44:10 +0200
branchstable
changeset 2093 e3aaf61f8c66
parent 1977 606923dff11b
permissions -rw-r--r--
field's help may now be a callable taking the form as argument
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1977
606923dff11b big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1398
diff changeset
     1
"""
606923dff11b big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1398
diff changeset
     2
606923dff11b big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1398
diff changeset
     3
:organization: Logilab
606923dff11b big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1398
diff changeset
     4
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
606923dff11b big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1398
diff changeset
     5
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
606923dff11b big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1398
diff changeset
     6
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
606923dff11b big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1398
diff changeset
     7
"""
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     8
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     9
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    10
class test(AttributeRelationType):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    11
    permissions = {'read': ('managers', 'users', 'guests'),
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    12
                   'delete': ('managers',),
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    13
                   'add': ('managers',)}
332
86b8d58664eb backport msplanner test from cubicweb-multisources
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents: 0
diff changeset
    14
86b8d58664eb backport msplanner test from cubicweb-multisources
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents: 0
diff changeset
    15
class fiche(RelationType):
86b8d58664eb backport msplanner test from cubicweb-multisources
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents: 0
diff changeset
    16
    inlined = True
86b8d58664eb backport msplanner test from cubicweb-multisources
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents: 0
diff changeset
    17
    subject = 'Personne'
86b8d58664eb backport msplanner test from cubicweb-multisources
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents: 0
diff changeset
    18
    object = 'Card'
86b8d58664eb backport msplanner test from cubicweb-multisources
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents: 0
diff changeset
    19
    cardinality = '??'
86b8d58664eb backport msplanner test from cubicweb-multisources
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents: 0
diff changeset
    20
86b8d58664eb backport msplanner test from cubicweb-multisources
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents: 0
diff changeset
    21
class multisource_rel(RelationDefinition):
86b8d58664eb backport msplanner test from cubicweb-multisources
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents: 0
diff changeset
    22
    subject = ('Card', 'Note')
86b8d58664eb backport msplanner test from cubicweb-multisources
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents: 0
diff changeset
    23
    object = 'Note'
86b8d58664eb backport msplanner test from cubicweb-multisources
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents: 0
diff changeset
    24
393
45a675515427 cross_relations support
sylvain.thenault@logilab.fr
parents: 360
diff changeset
    25
class multisource_crossed_rel(RelationDefinition):
45a675515427 cross_relations support
sylvain.thenault@logilab.fr
parents: 360
diff changeset
    26
    subject = ('Card', 'Note')
45a675515427 cross_relations support
sylvain.thenault@logilab.fr
parents: 360
diff changeset
    27
    object = 'Note'
45a675515427 cross_relations support
sylvain.thenault@logilab.fr
parents: 360
diff changeset
    28
341
0a426be2f3a2 fixes for some cases of neged inlined relations, may have to use (new) IntersectStep. XXX: write IntersectFetchStep
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents: 332
diff changeset
    29
class multisource_inlined_rel(RelationType):
0a426be2f3a2 fixes for some cases of neged inlined relations, may have to use (new) IntersectStep. XXX: write IntersectFetchStep
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents: 332
diff changeset
    30
    inlined = True
0a426be2f3a2 fixes for some cases of neged inlined relations, may have to use (new) IntersectStep. XXX: write IntersectFetchStep
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents: 332
diff changeset
    31
    cardinality = '?*'
0a426be2f3a2 fixes for some cases of neged inlined relations, may have to use (new) IntersectStep. XXX: write IntersectFetchStep
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents: 332
diff changeset
    32
    subject = ('Card', 'Note')
0a426be2f3a2 fixes for some cases of neged inlined relations, may have to use (new) IntersectStep. XXX: write IntersectFetchStep
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents: 332
diff changeset
    33
    object = ('Affaire', 'Note')
0a426be2f3a2 fixes for some cases of neged inlined relations, may have to use (new) IntersectStep. XXX: write IntersectFetchStep
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents: 332
diff changeset
    34
332
86b8d58664eb backport msplanner test from cubicweb-multisources
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents: 0
diff changeset
    35
86b8d58664eb backport msplanner test from cubicweb-multisources
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents: 0
diff changeset
    36
class see_also(RelationDefinition):
86b8d58664eb backport msplanner test from cubicweb-multisources
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents: 0
diff changeset
    37
    subject = ('Bookmark', 'Note')
86b8d58664eb backport msplanner test from cubicweb-multisources
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents: 0
diff changeset
    38
    object = ('Bookmark', 'Note')
360
600dd2fe8b40 backport unittest_ldapuser
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents: 341
diff changeset
    39
1398
5fe84a5f7035 rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents: 393
diff changeset
    40
_euser = import_schema('base').CWUser
360
600dd2fe8b40 backport unittest_ldapuser
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents: 341
diff changeset
    41
_euser.__relations__[0].fulltextindexed = True