test/data/schema.py
author sylvain.thenault@logilab.fr
Wed, 18 Feb 2009 11:09:55 +0100
branchtls-sprint
changeset 765 8fda14081686
parent 750 89e997bc2bf1
child 1398 5fe84a5f7035
permissions -rw-r--r--
kill Form, EntityForm and AnyRsetForm
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
744
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
     1
class Personne(EntityType):
748
eec752381926 unittest_entity ok
sylvain.thenault@logilab.fr
parents: 744
diff changeset
     2
    nom = String(required=True)
744
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
     3
    prenom = String()
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
     4
    type = String()
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
     5
    travaille = SubjectRelation('Societe')
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
     6
    evaluee = SubjectRelation(('Note', 'Personne'))
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
     7
    connait = SubjectRelation('Personne', symetric=True)
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
     8
    
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
     9
class Societe(EntityType):
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    10
    nom = String()
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    11
    evaluee = SubjectRelation('Note')
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    12
    
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    13
class Note(EntityType):
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    14
    type = String()
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    15
    ecrit_par = SubjectRelation('Personne')
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    16
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    17
class SubNote(Note):
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    18
    __specializes_schema__ = True
750
89e997bc2bf1 update test for new test schema
sylvain.thenault@logilab.fr
parents: 748
diff changeset
    19
    description = String()
744
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    20
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    21
class tags(RelationDefinition):
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    22
    subject = 'Tag'
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    23
    object = ('Personne', 'Note')
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    24
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    25
class evaluee(RelationDefinition):
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    26
    subject = 'EUser'
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    27
    object = 'Note'