test/data/entities.py
author sylvain.thenault@logilab.fr
Thu, 23 Apr 2009 17:57:46 +0200
branchtls-sprint
changeset 1455 a2c8b07d61b4
parent 744 4da6e0f4df2a
child 1473 717dea3362c0
permissions -rw-r--r--
refactor to get powerful etype_relation_field function which benefit from ui configuration (eg widgets and fields)

from cubicweb.entities import AnyEntity, fetch_config

class Personne(AnyEntity):
    """customized class forne Person entities"""
    id = 'Personne'
    fetch_attrs, fetch_order = fetch_config(['nom', 'prenom'])
    rest_attr = 'nom'


class Societe(AnyEntity):
    id = 'Societe'
    fetch_attrs = ('nom',)
    
class Note(AnyEntity):
    id = 'Note'