test/data/entities.py
author Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
Thu, 12 Mar 2009 09:29:32 +0100
branchtls-sprint
changeset 1088 b7b58c3bb575
parent 744 4da6e0f4df2a
child 1473 717dea3362c0
permissions -rw-r--r--
commit pending work (started in TLS): starting to implement Creation/Edition form with new form API
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
744
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
     1
from cubicweb.entities import AnyEntity, fetch_config
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
     2
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
     3
class Personne(AnyEntity):
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
     4
    """customized class forne Person entities"""
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
     5
    id = 'Personne'
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
     6
    fetch_attrs, fetch_order = fetch_config(['nom', 'prenom'])
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
     7
    rest_attr = 'nom'
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
     8
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
     9
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    10
class Societe(AnyEntity):
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    11
    id = 'Societe'
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    12
    fetch_attrs = ('nom',)
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    13
    
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    14
class Note(AnyEntity):
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    15
    id = 'Note'