test/data/entities.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 20 Apr 2010 18:34:37 +0200
changeset 5364 e0feefb87de5
parent 4252 6c4f109c2b03
child 5421 8167de96c523
permissions -rw-r--r--
[dbapi] some compat with distant < 3.8 repo
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: 1473
diff changeset
     1
"""
606923dff11b big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1473
diff changeset
     2
606923dff11b big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1473
diff changeset
     3
:organization: Logilab
4212
ab6573088b4a update copyright: welcome 2010
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1977
diff changeset
     4
:copyright: 2001-2010 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
1977
606923dff11b big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1473
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: 1473
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: 1473
diff changeset
     7
"""
744
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
     8
from cubicweb.entities import AnyEntity, fetch_config
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
     9
1473
717dea3362c0 more implements selector tests
sylvain.thenault@logilab.fr
parents: 744
diff changeset
    10
class Societe(AnyEntity):
3408
c92170fca813 [api] use __regid__ instead of deprecated id
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1977
diff changeset
    11
    __regid__ = 'Societe'
1473
717dea3362c0 more implements selector tests
sylvain.thenault@logilab.fr
parents: 744
diff changeset
    12
    fetch_attrs = ('nom',)
717dea3362c0 more implements selector tests
sylvain.thenault@logilab.fr
parents: 744
diff changeset
    13
717dea3362c0 more implements selector tests
sylvain.thenault@logilab.fr
parents: 744
diff changeset
    14
class Personne(Societe):
744
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    15
    """customized class forne Person entities"""
3408
c92170fca813 [api] use __regid__ instead of deprecated id
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1977
diff changeset
    16
    __regid__ = 'Personne'
744
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    17
    fetch_attrs, fetch_order = fetch_config(['nom', 'prenom'])
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    18
    rest_attr = 'nom'
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    19
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    20
4da6e0f4df2a test upgrade
sylvain.thenault@logilab.fr
parents:
diff changeset
    21
class Note(AnyEntity):
3408
c92170fca813 [api] use __regid__ instead of deprecated id
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1977
diff changeset
    22
    __regid__ = 'Note'