test/data/schema.py
author sylvain.thenault@logilab.fr
Wed, 06 May 2009 18:13:32 +0200
branchtls-sprint
changeset 1710 8c717cc0b353
parent 1476 f94b41709ce6
child 1977 606923dff11b
permissions -rw-r--r--
refactor error handling: get validation error information from a form attribute instead of req.data to avoid pb when multiple forms are displayed

class Personne(EntityType):
    nom = String(required=True)
    prenom = String()
    type = String()
    travaille = SubjectRelation('Societe')
    evaluee = SubjectRelation(('Note', 'Personne'))
    connait = SubjectRelation('Personne', symetric=True)

class Societe(EntityType):
    nom = String()
    evaluee = SubjectRelation('Note')

class Note(EntityType):
    type = String()
    ecrit_par = SubjectRelation('Personne')

class SubNote(Note):
    __specializes_schema__ = True
    description = String()

class tags(RelationDefinition):
    subject = 'Tag'
    object = ('Personne', 'Note')

class evaluee(RelationDefinition):
    subject = 'CWUser'
    object = 'Note'