[ui] Generate smarter dc_title for all entities
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 12 Jul 2016 15:02:52 +0200
changeset 1416 915e2adf4bc0
parent 1415 82a0bb69d528
child 1417 50e9afea655e
[ui] Generate smarter dc_title for all entities This is mostly useful for edition form a non-first-level subentities, to get proper display in the breadcrumbs.
entities/custom.py
entities/generated.py
xsd2entities.py
--- a/entities/custom.py	Tue Jul 12 14:47:16 2016 +0200
+++ b/entities/custom.py	Tue Jul 12 15:02:52 2016 +0200
@@ -17,6 +17,12 @@
 from cubes.seda.entities import generated
 
 
+class SEDAArchiveTransfer(generated.SEDAArchiveTransfer):
+
+    def dc_title(self):
+        return self.title
+
+
 class SEDAArchiveUnit(generated.SEDAArchiveUnit):
 
     @property
--- a/entities/generated.py	Tue Jul 12 14:47:16 2016 +0200
+++ b/entities/generated.py	Tue Jul 12 15:02:52 2016 +0200
@@ -17,707 +17,716 @@
 
 from cubicweb.entities import AnyEntity, fetch_config
 
-class SEDAArchiveTransfer(AnyEntity):
+class SEDAAnyEntity(AnyEntity):
+    value_attr = None
+
+    def dc_title(self):
+        if self.value_attr is None:
+            return self.dc_type()
+        return self.printable_value(self.value_attr)
+
+
+class SEDAArchiveTransfer(SEDAAnyEntity):
     __regid__ = 'SEDAArchiveTransfer'
     fetch_attrs, cw_fetch_order = fetch_config(['title', 'user_annotation'])
     value_attr = None
 
-class SEDAComment(AnyEntity):
+class SEDAComment(SEDAAnyEntity):
     __regid__ = 'SEDAComment'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'comment', 'user_annotation'])
     value_attr = 'comment'
 
-class SEDASignature(AnyEntity):
+class SEDASignature(SEDAAnyEntity):
     __regid__ = 'SEDASignature'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAArchivalAgreement(AnyEntity):
+class SEDAArchivalAgreement(SEDAAnyEntity):
     __regid__ = 'SEDAArchivalAgreement'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'archival_agreement', 'user_annotation'])
     value_attr = 'archival_agreement'
 
-class SEDARelatedTransferReference(AnyEntity):
+class SEDARelatedTransferReference(SEDAAnyEntity):
     __regid__ = 'SEDARelatedTransferReference'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDATransferRequestReplyIdentifier(AnyEntity):
+class SEDATransferRequestReplyIdentifier(SEDAAnyEntity):
     __regid__ = 'SEDATransferRequestReplyIdentifier'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDABinaryDataObject(AnyEntity):
+class SEDABinaryDataObject(SEDAAnyEntity):
     __regid__ = 'SEDABinaryDataObject'
     fetch_attrs, cw_fetch_order = fetch_config(['id', 'filename', 'user_cardinality', 'user_annotation'])
     value_attr = 'id'
 
-class SEDAPhysicalDataObject(AnyEntity):
+class SEDAPhysicalDataObject(SEDAAnyEntity):
     __regid__ = 'SEDAPhysicalDataObject'
     fetch_attrs, cw_fetch_order = fetch_config(['id', 'user_cardinality', 'user_annotation'])
     value_attr = 'id'
 
-class SEDAServiceLevel(AnyEntity):
+class SEDAServiceLevel(SEDAAnyEntity):
     __regid__ = 'SEDAServiceLevel'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'service_level', 'user_annotation'])
     value_attr = 'service_level'
 
-class SEDAStorageRule(AnyEntity):
+class SEDAStorageRule(SEDAAnyEntity):
     __regid__ = 'SEDAStorageRule'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAAppraisalRule(AnyEntity):
+class SEDAAppraisalRule(SEDAAnyEntity):
     __regid__ = 'SEDAAppraisalRule'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAAccessRule(AnyEntity):
+class SEDAAccessRule(SEDAAnyEntity):
     __regid__ = 'SEDAAccessRule'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDADisseminationRule(AnyEntity):
+class SEDADisseminationRule(SEDAAnyEntity):
     __regid__ = 'SEDADisseminationRule'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAReuseRule(AnyEntity):
+class SEDAReuseRule(SEDAAnyEntity):
     __regid__ = 'SEDAReuseRule'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAClassificationRule(AnyEntity):
+class SEDAClassificationRule(SEDAAnyEntity):
     __regid__ = 'SEDAClassificationRule'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'classification_owner', 'user_annotation'])
     value_attr = 'classification_owner'
 
-class SEDANeedAuthorization(AnyEntity):
+class SEDANeedAuthorization(SEDAAnyEntity):
     __regid__ = 'SEDANeedAuthorization'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'need_authorization', 'user_annotation'])
     value_attr = 'need_authorization'
 
-class SEDASeqClassificationRuleRule(AnyEntity):
+class SEDASeqClassificationRuleRule(SEDAAnyEntity):
     __regid__ = 'SEDASeqClassificationRuleRule'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAAltClassificationRulePreventInheritance(AnyEntity):
+class SEDAAltClassificationRulePreventInheritance(SEDAAnyEntity):
     __regid__ = 'SEDAAltClassificationRulePreventInheritance'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAClassificationReassessingDate(AnyEntity):
+class SEDAClassificationReassessingDate(SEDAAnyEntity):
     __regid__ = 'SEDAClassificationReassessingDate'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDANeedReassessingAuthorization(AnyEntity):
+class SEDANeedReassessingAuthorization(SEDAAnyEntity):
     __regid__ = 'SEDANeedReassessingAuthorization'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'need_reassessing_authorization', 'user_annotation'])
     value_attr = 'need_reassessing_authorization'
 
-class SEDAPreventInheritance(AnyEntity):
+class SEDAPreventInheritance(SEDAAnyEntity):
     __regid__ = 'SEDAPreventInheritance'
     fetch_attrs, cw_fetch_order = fetch_config(['prevent_inheritance'])
     value_attr = 'prevent_inheritance'
 
-class SEDARefNonRuleId(AnyEntity):
+class SEDARefNonRuleId(SEDAAnyEntity):
     __regid__ = 'SEDARefNonRuleId'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAStartDate(AnyEntity):
+class SEDAStartDate(SEDAAnyEntity):
     __regid__ = 'SEDAStartDate'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDASeqReuseRuleRule(AnyEntity):
+class SEDASeqReuseRuleRule(SEDAAnyEntity):
     __regid__ = 'SEDASeqReuseRuleRule'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAAltReuseRulePreventInheritance(AnyEntity):
+class SEDAAltReuseRulePreventInheritance(SEDAAnyEntity):
     __regid__ = 'SEDAAltReuseRulePreventInheritance'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDASeqDisseminationRuleRule(AnyEntity):
+class SEDASeqDisseminationRuleRule(SEDAAnyEntity):
     __regid__ = 'SEDASeqDisseminationRuleRule'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAAltDisseminationRulePreventInheritance(AnyEntity):
+class SEDAAltDisseminationRulePreventInheritance(SEDAAnyEntity):
     __regid__ = 'SEDAAltDisseminationRulePreventInheritance'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDASeqAccessRuleRule(AnyEntity):
+class SEDASeqAccessRuleRule(SEDAAnyEntity):
     __regid__ = 'SEDASeqAccessRuleRule'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAAltAccessRulePreventInheritance(AnyEntity):
+class SEDAAltAccessRulePreventInheritance(SEDAAnyEntity):
     __regid__ = 'SEDAAltAccessRulePreventInheritance'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDASeqAppraisalRuleRule(AnyEntity):
+class SEDASeqAppraisalRuleRule(SEDAAnyEntity):
     __regid__ = 'SEDASeqAppraisalRuleRule'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAAltAppraisalRulePreventInheritance(AnyEntity):
+class SEDAAltAppraisalRulePreventInheritance(SEDAAnyEntity):
     __regid__ = 'SEDAAltAppraisalRulePreventInheritance'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDASeqStorageRuleRule(AnyEntity):
+class SEDASeqStorageRuleRule(SEDAAnyEntity):
     __regid__ = 'SEDASeqStorageRuleRule'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAAltStorageRulePreventInheritance(AnyEntity):
+class SEDAAltStorageRulePreventInheritance(SEDAAnyEntity):
     __regid__ = 'SEDAAltStorageRulePreventInheritance'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAArchiveUnit(AnyEntity):
+class SEDAArchiveUnit(SEDAAnyEntity):
     __regid__ = 'SEDAArchiveUnit'
     fetch_attrs, cw_fetch_order = fetch_config(['id', 'user_cardinality', 'user_annotation'])
     value_attr = 'id'
 
-class SEDAAltArchiveUnitArchiveUnitRefId(AnyEntity):
+class SEDAAltArchiveUnitArchiveUnitRefId(SEDAAnyEntity):
     __regid__ = 'SEDAAltArchiveUnitArchiveUnitRefId'
     fetch_attrs, cw_fetch_order = fetch_config([])
     value_attr = None
 
-class SEDAArchiveUnitRefId(AnyEntity):
+class SEDAArchiveUnitRefId(SEDAAnyEntity):
     __regid__ = 'SEDAArchiveUnitRefId'
     fetch_attrs, cw_fetch_order = fetch_config([])
     value_attr = None
 
-class SEDASeqAltArchiveUnitArchiveUnitRefIdManagement(AnyEntity):
+class SEDASeqAltArchiveUnitArchiveUnitRefIdManagement(SEDAAnyEntity):
     __regid__ = 'SEDASeqAltArchiveUnitArchiveUnitRefIdManagement'
     fetch_attrs, cw_fetch_order = fetch_config([])
     value_attr = None
 
-class SEDAContent(AnyEntity):
+class SEDAContent(SEDAAnyEntity):
     __regid__ = 'SEDAContent'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDADataObjectReference(AnyEntity):
+class SEDADataObjectReference(SEDAAnyEntity):
     __regid__ = 'SEDADataObjectReference'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDArestrictionRuleIdRef(AnyEntity):
+class SEDArestrictionRuleIdRef(SEDAAnyEntity):
     __regid__ = 'SEDArestrictionRuleIdRef'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'restriction_rule_id_ref', 'user_annotation'])
     value_attr = 'restriction_rule_id_ref'
 
-class SEDArestrictionValue(AnyEntity):
+class SEDArestrictionValue(SEDAAnyEntity):
     __regid__ = 'SEDArestrictionValue'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'restriction_value', 'user_annotation'])
     value_attr = 'restriction_value'
 
-class SEDArestrictionEndDate(AnyEntity):
+class SEDArestrictionEndDate(SEDAAnyEntity):
     __regid__ = 'SEDArestrictionEndDate'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDATitle(AnyEntity):
+class SEDATitle(SEDAAnyEntity):
     __regid__ = 'SEDATitle'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'title', 'user_annotation'])
     value_attr = 'title'
 
-class SEDAFilePlanPosition(AnyEntity):
+class SEDAFilePlanPosition(SEDAAnyEntity):
     __regid__ = 'SEDAFilePlanPosition'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'file_plan_position', 'user_annotation'])
     value_attr = 'file_plan_position'
 
-class SEDASystemId(AnyEntity):
+class SEDASystemId(SEDAAnyEntity):
     __regid__ = 'SEDASystemId'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAOriginatingSystemId(AnyEntity):
+class SEDAOriginatingSystemId(SEDAAnyEntity):
     __regid__ = 'SEDAOriginatingSystemId'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAArchivalAgencyArchiveUnitIdentifier(AnyEntity):
+class SEDAArchivalAgencyArchiveUnitIdentifier(SEDAAnyEntity):
     __regid__ = 'SEDAArchivalAgencyArchiveUnitIdentifier'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'archival_agency_archive_unit_identifier', 'user_annotation'])
     value_attr = 'archival_agency_archive_unit_identifier'
 
-class SEDAOriginatingAgencyArchiveUnitIdentifier(AnyEntity):
+class SEDAOriginatingAgencyArchiveUnitIdentifier(SEDAAnyEntity):
     __regid__ = 'SEDAOriginatingAgencyArchiveUnitIdentifier'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'originating_agency_archive_unit_identifier', 'user_annotation'])
     value_attr = 'originating_agency_archive_unit_identifier'
 
-class SEDATransferringAgencyArchiveUnitIdentifier(AnyEntity):
+class SEDATransferringAgencyArchiveUnitIdentifier(SEDAAnyEntity):
     __regid__ = 'SEDATransferringAgencyArchiveUnitIdentifier'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'transferring_agency_archive_unit_identifier', 'user_annotation'])
     value_attr = 'transferring_agency_archive_unit_identifier'
 
-class SEDADescription(AnyEntity):
+class SEDADescription(SEDAAnyEntity):
     __regid__ = 'SEDADescription'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'description', 'user_annotation'])
     value_attr = 'description'
 
-class SEDAType(AnyEntity):
+class SEDAType(SEDAAnyEntity):
     __regid__ = 'SEDAType'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'type', 'user_annotation'])
     value_attr = 'type'
 
-class SEDADocumentType(AnyEntity):
+class SEDADocumentType(SEDAAnyEntity):
     __regid__ = 'SEDADocumentType'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'document_type', 'user_annotation'])
     value_attr = 'document_type'
 
-class SEDALanguage(AnyEntity):
+class SEDALanguage(SEDAAnyEntity):
     __regid__ = 'SEDALanguage'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDADescriptionLanguage(AnyEntity):
+class SEDADescriptionLanguage(SEDAAnyEntity):
     __regid__ = 'SEDADescriptionLanguage'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAStatus(AnyEntity):
+class SEDAStatus(SEDAAnyEntity):
     __regid__ = 'SEDAStatus'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'status', 'user_annotation'])
     value_attr = 'status'
 
-class SEDAVersion(AnyEntity):
+class SEDAVersion(SEDAAnyEntity):
     __regid__ = 'SEDAVersion'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'version', 'user_annotation'])
     value_attr = 'version'
 
-class SEDATag(AnyEntity):
+class SEDATag(SEDAAnyEntity):
     __regid__ = 'SEDATag'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'tag', 'user_annotation'])
     value_attr = 'tag'
 
-class SEDAKeyword(AnyEntity):
+class SEDAKeyword(SEDAAnyEntity):
     __regid__ = 'SEDAKeyword'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAOriginatingAgency(AnyEntity):
+class SEDAOriginatingAgency(SEDAAnyEntity):
     __regid__ = 'SEDAOriginatingAgency'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDASubmissionAgency(AnyEntity):
+class SEDASubmissionAgency(SEDAAnyEntity):
     __regid__ = 'SEDASubmissionAgency'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAAuthorizedAgent(AnyEntity):
+class SEDAAuthorizedAgent(SEDAAnyEntity):
     __regid__ = 'SEDAAuthorizedAgent'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAWriter(AnyEntity):
+class SEDAWriter(SEDAAnyEntity):
     __regid__ = 'SEDAWriter'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAAddressee(AnyEntity):
+class SEDAAddressee(SEDAAnyEntity):
     __regid__ = 'SEDAAddressee'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDARecipient(AnyEntity):
+class SEDARecipient(SEDAAnyEntity):
     __regid__ = 'SEDARecipient'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDASource(AnyEntity):
+class SEDASource(SEDAAnyEntity):
     __regid__ = 'SEDASource'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'source', 'user_annotation'])
     value_attr = 'source'
 
-class SEDACreatedDate(AnyEntity):
+class SEDACreatedDate(SEDAAnyEntity):
     __regid__ = 'SEDACreatedDate'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDATransactedDate(AnyEntity):
+class SEDATransactedDate(SEDAAnyEntity):
     __regid__ = 'SEDATransactedDate'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAAcquiredDate(AnyEntity):
+class SEDAAcquiredDate(SEDAAnyEntity):
     __regid__ = 'SEDAAcquiredDate'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDASentDate(AnyEntity):
+class SEDASentDate(SEDAAnyEntity):
     __regid__ = 'SEDASentDate'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAReceivedDate(AnyEntity):
+class SEDAReceivedDate(SEDAAnyEntity):
     __regid__ = 'SEDAReceivedDate'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDARegisteredDate(AnyEntity):
+class SEDARegisteredDate(SEDAAnyEntity):
     __regid__ = 'SEDARegisteredDate'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAEndDate(AnyEntity):
+class SEDAEndDate(SEDAAnyEntity):
     __regid__ = 'SEDAEndDate'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAEvent(AnyEntity):
+class SEDAEvent(SEDAAnyEntity):
     __regid__ = 'SEDAEvent'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAGpsVersionID(AnyEntity):
+class SEDAGpsVersionID(SEDAAnyEntity):
     __regid__ = 'SEDAGpsVersionID'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAGpsAltitude(AnyEntity):
+class SEDAGpsAltitude(SEDAAnyEntity):
     __regid__ = 'SEDAGpsAltitude'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAGpsAltitudeRef(AnyEntity):
+class SEDAGpsAltitudeRef(SEDAAnyEntity):
     __regid__ = 'SEDAGpsAltitudeRef'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAGpsLatitude(AnyEntity):
+class SEDAGpsLatitude(SEDAAnyEntity):
     __regid__ = 'SEDAGpsLatitude'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAGpsLatitudeRef(AnyEntity):
+class SEDAGpsLatitudeRef(SEDAAnyEntity):
     __regid__ = 'SEDAGpsLatitudeRef'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAGpsLongitude(AnyEntity):
+class SEDAGpsLongitude(SEDAAnyEntity):
     __regid__ = 'SEDAGpsLongitude'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAGpsLongitudeRef(AnyEntity):
+class SEDAGpsLongitudeRef(SEDAAnyEntity):
     __regid__ = 'SEDAGpsLongitudeRef'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAGpsDateStamp(AnyEntity):
+class SEDAGpsDateStamp(SEDAAnyEntity):
     __regid__ = 'SEDAGpsDateStamp'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAEventIdentifier(AnyEntity):
+class SEDAEventIdentifier(SEDAAnyEntity):
     __regid__ = 'SEDAEventIdentifier'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAEventType(AnyEntity):
+class SEDAEventType(SEDAAnyEntity):
     __regid__ = 'SEDAEventType'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAEventDetail(AnyEntity):
+class SEDAEventDetail(SEDAAnyEntity):
     __regid__ = 'SEDAEventDetail'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAIsVersionOf(AnyEntity):
+class SEDAIsVersionOf(SEDAAnyEntity):
     __regid__ = 'SEDAIsVersionOf'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAReplaces(AnyEntity):
+class SEDAReplaces(SEDAAnyEntity):
     __regid__ = 'SEDAReplaces'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDARequires(AnyEntity):
+class SEDARequires(SEDAAnyEntity):
     __regid__ = 'SEDARequires'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAIsPartOf(AnyEntity):
+class SEDAIsPartOf(SEDAAnyEntity):
     __regid__ = 'SEDAIsPartOf'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAReferences(AnyEntity):
+class SEDAReferences(SEDAAnyEntity):
     __regid__ = 'SEDAReferences'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAAltReferencesArchiveUnitRefId(AnyEntity):
+class SEDAAltReferencesArchiveUnitRefId(SEDAAnyEntity):
     __regid__ = 'SEDAAltReferencesArchiveUnitRefId'
     fetch_attrs, cw_fetch_order = fetch_config([])
     value_attr = None
 
-class SEDARepositoryArchiveUnitPID(AnyEntity):
+class SEDARepositoryArchiveUnitPID(SEDAAnyEntity):
     __regid__ = 'SEDARepositoryArchiveUnitPID'
     fetch_attrs, cw_fetch_order = fetch_config([])
     value_attr = None
 
-class SEDARepositoryObjectPID(AnyEntity):
+class SEDARepositoryObjectPID(SEDAAnyEntity):
     __regid__ = 'SEDARepositoryObjectPID'
     fetch_attrs, cw_fetch_order = fetch_config([])
     value_attr = None
 
-class SEDAAltIsPartOfArchiveUnitRefId(AnyEntity):
+class SEDAAltIsPartOfArchiveUnitRefId(SEDAAnyEntity):
     __regid__ = 'SEDAAltIsPartOfArchiveUnitRefId'
     fetch_attrs, cw_fetch_order = fetch_config([])
     value_attr = None
 
-class SEDAAltRequiresArchiveUnitRefId(AnyEntity):
+class SEDAAltRequiresArchiveUnitRefId(SEDAAnyEntity):
     __regid__ = 'SEDAAltRequiresArchiveUnitRefId'
     fetch_attrs, cw_fetch_order = fetch_config([])
     value_attr = None
 
-class SEDAAltReplacesArchiveUnitRefId(AnyEntity):
+class SEDAAltReplacesArchiveUnitRefId(SEDAAnyEntity):
     __regid__ = 'SEDAAltReplacesArchiveUnitRefId'
     fetch_attrs, cw_fetch_order = fetch_config([])
     value_attr = None
 
-class SEDAAltIsVersionOfArchiveUnitRefId(AnyEntity):
+class SEDAAltIsVersionOfArchiveUnitRefId(SEDAAnyEntity):
     __regid__ = 'SEDAAltIsVersionOfArchiveUnitRefId'
     fetch_attrs, cw_fetch_order = fetch_config([])
     value_attr = None
 
-class SEDASpatial(AnyEntity):
+class SEDASpatial(SEDAAnyEntity):
     __regid__ = 'SEDASpatial'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'spatial', 'user_annotation'])
     value_attr = 'spatial'
 
-class SEDATemporal(AnyEntity):
+class SEDATemporal(SEDAAnyEntity):
     __regid__ = 'SEDATemporal'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'temporal', 'user_annotation'])
     value_attr = 'temporal'
 
-class SEDAJuridictional(AnyEntity):
+class SEDAJuridictional(SEDAAnyEntity):
     __regid__ = 'SEDAJuridictional'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'juridictional', 'user_annotation'])
     value_attr = 'juridictional'
 
-class SEDAKeywordContent(AnyEntity):
+class SEDAKeywordContent(SEDAAnyEntity):
     __regid__ = 'SEDAKeywordContent'
     fetch_attrs, cw_fetch_order = fetch_config(['keyword_content'])
     value_attr = 'keyword_content'
 
-class SEDAKeywordReference(AnyEntity):
+class SEDAKeywordReference(SEDAAnyEntity):
     __regid__ = 'SEDAKeywordReference'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAKeywordType(AnyEntity):
+class SEDAKeywordType(SEDAAnyEntity):
     __regid__ = 'SEDAKeywordType'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDACustodialHistoryItem(AnyEntity):
+class SEDACustodialHistoryItem(SEDAAnyEntity):
     __regid__ = 'SEDACustodialHistoryItem'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'custodial_history_item', 'user_annotation'])
     value_attr = 'custodial_history_item'
 
-class SEDACustodialHistoryFile(AnyEntity):
+class SEDACustodialHistoryFile(SEDAAnyEntity):
     __regid__ = 'SEDACustodialHistoryFile'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAwhen(AnyEntity):
+class SEDAwhen(SEDAAnyEntity):
     __regid__ = 'SEDAwhen'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDARelationship(AnyEntity):
+class SEDARelationship(SEDAAnyEntity):
     __regid__ = 'SEDARelationship'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDADataObjectVersion(AnyEntity):
+class SEDADataObjectVersion(SEDAAnyEntity):
     __regid__ = 'SEDADataObjectVersion'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAWidth(AnyEntity):
+class SEDAWidth(SEDAAnyEntity):
     __regid__ = 'SEDAWidth'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAHeight(AnyEntity):
+class SEDAHeight(SEDAAnyEntity):
     __regid__ = 'SEDAHeight'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDADepth(AnyEntity):
+class SEDADepth(SEDAAnyEntity):
     __regid__ = 'SEDADepth'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAShape(AnyEntity):
+class SEDAShape(SEDAAnyEntity):
     __regid__ = 'SEDAShape'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDADiameter(AnyEntity):
+class SEDADiameter(SEDAAnyEntity):
     __regid__ = 'SEDADiameter'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDALength(AnyEntity):
+class SEDALength(SEDAAnyEntity):
     __regid__ = 'SEDALength'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAThickness(AnyEntity):
+class SEDAThickness(SEDAAnyEntity):
     __regid__ = 'SEDAThickness'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAWeight(AnyEntity):
+class SEDAWeight(SEDAAnyEntity):
     __regid__ = 'SEDAWeight'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDANumberOfPage(AnyEntity):
+class SEDANumberOfPage(SEDAAnyEntity):
     __regid__ = 'SEDANumberOfPage'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAAltBinaryDataObjectAttachment(AnyEntity):
+class SEDAAltBinaryDataObjectAttachment(SEDAAnyEntity):
     __regid__ = 'SEDAAltBinaryDataObjectAttachment'
     fetch_attrs, cw_fetch_order = fetch_config([])
     value_attr = None
 
-class SEDACompressed(AnyEntity):
+class SEDACompressed(SEDAAnyEntity):
     __regid__ = 'SEDACompressed'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'compressed', 'user_annotation'])
     value_attr = 'compressed'
 
-class SEDACreatingApplicationName(AnyEntity):
+class SEDACreatingApplicationName(SEDAAnyEntity):
     __regid__ = 'SEDACreatingApplicationName'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'creating_application_name', 'user_annotation'])
     value_attr = 'creating_application_name'
 
-class SEDACreatingApplicationVersion(AnyEntity):
+class SEDACreatingApplicationVersion(SEDAAnyEntity):
     __regid__ = 'SEDACreatingApplicationVersion'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'creating_application_version', 'user_annotation'])
     value_attr = 'creating_application_version'
 
-class SEDADateCreatedByApplication(AnyEntity):
+class SEDADateCreatedByApplication(SEDAAnyEntity):
     __regid__ = 'SEDADateCreatedByApplication'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDACreatingOs(AnyEntity):
+class SEDACreatingOs(SEDAAnyEntity):
     __regid__ = 'SEDACreatingOs'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'creating_os', 'user_annotation'])
     value_attr = 'creating_os'
 
-class SEDACreatingOsVersion(AnyEntity):
+class SEDACreatingOsVersion(SEDAAnyEntity):
     __regid__ = 'SEDACreatingOsVersion'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'creating_os_version', 'user_annotation'])
     value_attr = 'creating_os_version'
 
-class SEDALastModified(AnyEntity):
+class SEDALastModified(SEDAAnyEntity):
     __regid__ = 'SEDALastModified'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAFormatLitteral(AnyEntity):
+class SEDAFormatLitteral(SEDAAnyEntity):
     __regid__ = 'SEDAFormatLitteral'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'format_litteral', 'user_annotation'])
     value_attr = 'format_litteral'
 
-class SEDAMimeType(AnyEntity):
+class SEDAMimeType(SEDAAnyEntity):
     __regid__ = 'SEDAMimeType'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAFormatId(AnyEntity):
+class SEDAFormatId(SEDAAnyEntity):
     __regid__ = 'SEDAFormatId'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAEncoding(AnyEntity):
+class SEDAEncoding(SEDAAnyEntity):
     __regid__ = 'SEDAEncoding'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAAttachment(AnyEntity):
+class SEDAAttachment(SEDAAnyEntity):
     __regid__ = 'SEDAAttachment'
     fetch_attrs, cw_fetch_order = fetch_config([])
     value_attr = None
 
-class SEDAUri(AnyEntity):
+class SEDAUri(SEDAAnyEntity):
     __regid__ = 'SEDAUri'
     fetch_attrs, cw_fetch_order = fetch_config([])
     value_attr = None
 
-class SEDAMimeTypeCodeListVersion(AnyEntity):
+class SEDAMimeTypeCodeListVersion(SEDAAnyEntity):
     __regid__ = 'SEDAMimeTypeCodeListVersion'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAEncodingCodeListVersion(AnyEntity):
+class SEDAEncodingCodeListVersion(SEDAAnyEntity):
     __regid__ = 'SEDAEncodingCodeListVersion'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDACompressionAlgorithmCodeListVersion(AnyEntity):
+class SEDACompressionAlgorithmCodeListVersion(SEDAAnyEntity):
     __regid__ = 'SEDACompressionAlgorithmCodeListVersion'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDADataObjectVersionCodeListVersion(AnyEntity):
+class SEDADataObjectVersionCodeListVersion(SEDAAnyEntity):
     __regid__ = 'SEDADataObjectVersionCodeListVersion'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAStorageRuleCodeListVersion(AnyEntity):
+class SEDAStorageRuleCodeListVersion(SEDAAnyEntity):
     __regid__ = 'SEDAStorageRuleCodeListVersion'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAAppraisalRuleCodeListVersion(AnyEntity):
+class SEDAAppraisalRuleCodeListVersion(SEDAAnyEntity):
     __regid__ = 'SEDAAppraisalRuleCodeListVersion'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAAccessRuleCodeListVersion(AnyEntity):
+class SEDAAccessRuleCodeListVersion(SEDAAnyEntity):
     __regid__ = 'SEDAAccessRuleCodeListVersion'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDADisseminationRuleCodeListVersion(AnyEntity):
+class SEDADisseminationRuleCodeListVersion(SEDAAnyEntity):
     __regid__ = 'SEDADisseminationRuleCodeListVersion'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAReuseRuleCodeListVersion(AnyEntity):
+class SEDAReuseRuleCodeListVersion(SEDAAnyEntity):
     __regid__ = 'SEDAReuseRuleCodeListVersion'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDAClassificationRuleCodeListVersion(AnyEntity):
+class SEDAClassificationRuleCodeListVersion(SEDAAnyEntity):
     __regid__ = 'SEDAClassificationRuleCodeListVersion'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
-class SEDARelationshipCodeListVersion(AnyEntity):
+class SEDARelationshipCodeListVersion(SEDAAnyEntity):
     __regid__ = 'SEDARelationshipCodeListVersion'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
--- a/xsd2entities.py	Tue Jul 12 14:47:16 2016 +0200
+++ b/xsd2entities.py	Tue Jul 12 15:02:52 2016 +0200
@@ -21,7 +21,7 @@
 from xsd2uicfg import ordered_attributes
 
 
-TEMPLATE = '''class {etype}(AnyEntity):
+TEMPLATE = '''class {etype}(SEDAAnyEntity):
     __regid__ = '{etype}'
     fetch_attrs, cw_fetch_order = fetch_config({attributes})
     value_attr = {value_attribute}
@@ -32,6 +32,16 @@
 
     def _generate(self, mapping, stream):
         stream.write('from cubicweb.entities import AnyEntity, fetch_config\n\n')
+        stream.write('''class SEDAAnyEntity(AnyEntity):
+    value_attr = None
+
+    def dc_title(self):
+        if self.value_attr is None:
+            return self.dc_type()
+        return self.printable_value(self.value_attr)
+
+
+''')
         self.altetype2rtype = {}  # registry of rtype to children elements for all choices
         for mapping_element in mapping.ordered:
             self._callback('register_alt_rtype_for', mapping_element)