[PATCH eac] Add support for new entities

Guillaume Vandevelde guillaume.vandevelde at logilab.fr
Thu Aug 29 10:45:54 CEST 2019


# HG changeset patch
# User Guillaume Vandevelde <gvandevelde at logilab.fr>
# Date 1563895921 -7200
#      Tue Jul 23 17:32:01 2019 +0200
# Node ID ddc2ddcb51fc5e3f6c49d7e7e3497014e0c6d0fd
# Parent  3a275e0427675b6d19be0c7e78d78a06b55c7ce7
# Available At http://hg.logilab.org/review/cubes/eac
#              hg pull http://hg.logilab.org/review/cubes/eac -r ddc2ddcb51fc
Add support for new entities

diff -r 3a275e042767 -r ddc2ddcb51fc cubicweb_eac/entities.py
--- a/cubicweb_eac/entities.py	Thu Jul 11 17:45:03 2019 +0200
+++ b/cubicweb_eac/entities.py	Tue Jul 23 17:32:01 2019 +0200
@@ -125,6 +125,11 @@
         return self.hierarchical_child[0]
 
 
+class GeneralContext(AnyEntity):
+    __regid__ = 'GeneralContext'
+    fetch_attrs, cw_fetch_order = fetch_config(('content',))
+
+
 class JsonAttrsMixin(object):
 
     @property
@@ -177,6 +182,12 @@
             return self.function_relation_function[0]
 
 
+class DateEntity(AnyEntity):
+    __regid__ = 'DateEntity'
+    fetch_attrs, cw_fetch_order = fetch_config(('start_date',
+                                                'end_date'))
+
+
 class SameAsMixIn(object):
     """Mix-in class for entity types supporting vocabulary_source and
     equivalent_concept relations.
@@ -220,6 +231,11 @@
     fetch_attrs, cw_fetch_order = fetch_config(('term', 'description'))
 
 
+class Structure(AnyEntity):
+    __regid__ = 'Structure'
+    fetch_attrs, cw_fetch_order = fetch_config(('description',))
+
+
 class EACSource(AnyEntity):
     __regid__ = 'EACSource'
     fetch_attrs, cw_fetch_order = fetch_config(('title', 'url', 'description'))
@@ -230,7 +246,12 @@
     fetch_attrs, cw_fetch_order = fetch_config(('local_type', 'value'))
 
 
-class HistoricalEvent(AnyEntity, DateRelationMixin):
+class History(AnyEntity):
+    __regid__ = 'History'
+    fetch_attrs, cw_fetch_order = fetch_config(('abstract', 'text'))
+
+
+class HistoricalEvent(DateRelationMixin, AnyEntity):
     __regid__ = 'HistoricalEvent'
     fetch_attrs, cw_fetch_order = fetch_config(('event',))
 



More information about the saem-devel mailing list