test/data/entities.py
author sylvain.thenault@logilab.fr
Fri, 24 Apr 2009 15:38:11 +0200
branchtls-sprint
changeset 1473 717dea3362c0
parent 744 4da6e0f4df2a
child 1977 606923dff11b
permissions -rw-r--r--
more implements selector tests
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
1473
717dea3362c0 more implements selector tests
sylvain.thenault@logilab.fr
parents: 744
diff changeset
     3
class Societe(AnyEntity):
717dea3362c0 more implements selector tests
sylvain.thenault@logilab.fr
parents: 744
diff changeset
     4
    id = 'Societe'
717dea3362c0 more implements selector tests
sylvain.thenault@logilab.fr
parents: 744
diff changeset
     5
    fetch_attrs = ('nom',)
717dea3362c0 more implements selector tests
sylvain.thenault@logilab.fr
parents: 744
diff changeset
     6
717dea3362c0 more implements selector tests
sylvain.thenault@logilab.fr
parents: 744
diff changeset
     7
class Personne(Societe):
744
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
     8
    """customized class forne Person entities"""
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
     9
    id = 'Personne'
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    10
    fetch_attrs, fetch_order = fetch_config(['nom', 'prenom'])
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    11
    rest_attr = 'nom'
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    12
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'