[PATCH 9 of 9 saem_ref] [eac] Properly skip ExternalUri in timeline

Denis Laxalde denis.laxalde at logilab.fr
Tue Mar 21 10:28:40 CET 2017


Sylvain Thénault a écrit :
>
> Le 20/03/2017 à 09:31, Denis Laxalde a écrit :
>> Sylvain Thenault a écrit :
>>> # HG changeset patch
>>> # User Sylvain Thénault <sylvain.thenault at logilab.fr>
>>> # Date 1489675201 -3600
>>> #      Thu Mar 16 15:40:01 2017 +0100
>>> # Node ID 4903c283838fb8ef601ffdb57b9cdd91f36dec1c
>>> # Parent  35b37b8be87d1696e4917a92fd606291ed4e0d53
>>> [eac] Properly skip ExternalUri in timeline
>>>
>>> else it ends up crashing.
>>>
>>> diff --git a/cubicweb_saem_ref/views/authorityrecord.py
>>> b/cubicweb_saem_ref/views/authorityrecord.py
>>> --- a/cubicweb_saem_ref/views/authorityrecord.py
>>> +++ b/cubicweb_saem_ref/views/authorityrecord.py
>>> @@ -686,16 +686,18 @@ class ChronologicalRelationView(EntityVi
>>>          has_related_entities('chronological_predecessor',
>>> role='object'))
>>>      title = _('ChronologicalRelation_plural')
>>>
>>>      def entity_call(self, entity, **kwargs):
>>>          self.w(tags.h2(self._cw._(self.title).lower()))
>>> -        rset = self._cw.execute('(Any X WHERE X eid %(eid)s) '
>>> -                                'UNION (Any S WHERE RP
>>> chronological_predecessor X, '
>>> -                                '       RP chronological_successor
>>> S, X eid %(eid)s) '
>>> -                                'UNION (Any P WHERE RS
>>> chronological_successor X, '
>>> -                                '       RS chronological_predecessor
>>> P, X eid %(eid)s)',
>>> -                                {'eid': entity.eid})
>>> +
>>> +        rset = self._cw.execute(
>>> +            '(Any X WHERE X eid %(eid)s) '
>>> +            'UNION (Any S WHERE S is AuthorityRecord, RP
>>> chronological_predecessor X, '
>>> +            '       RP chronological_successor S, X eid %(eid)s) '
>>> +            'UNION (Any P WHERE P is AuthorityRecord, RS
>>> chronological_successor X, '
>>> +            '       RS chronological_predecessor P, X eid %(eid)s)',
>>> +            {'eid': entity.eid})
>> unrelated
> it is related, notice addition of 'is' restriction in subqueries.
>

Changing formatting along with content does not help grasping such 
changes...



More information about the saem-devel mailing list