[PATCH 06 of 13 saem_ref] [seda] Configure the seda compound tree to stop considering Activity

Denis Laxalde denis.laxalde at logilab.fr
Mon Apr 10 13:22:14 CEST 2017


Sylvain Thenault a écrit :
> # HG changeset patch
> # User Sylvain Thénault <sylvain.thenault at logilab.fr>
> # Date 1490876699 -7200
> #      Thu Mar 30 14:24:59 2017 +0200
> # Node ID 85982216f0b9c4d28573bbbd4fcef44c1324ac8e
> # Parent  072cf8603672c8e33a27e4cef6edc5d40a656afa
> [seda] Configure the seda compound tree to stop considering Activity
>
> We've already fixed permission issues from the same problem (Activity being
> added by saem_ref and in several compound trees). Now, it appears that 'used'
> and 'generated' relations appear in the SEDA_PARENT_RTYPES structure of
> seda's hooks, leading to a container relation being set for activities even when
> they belong to a scheme, concept or authority record, even though this relation
> doesn't exists in the schema. This causes later problem, such has being unable
> to remove those entities (hence the non regression test).
>
> Instead of simply fixing SEDA_PARENT_RTYPES, make the seda compound tree
> configurable and skip activity once for all so we may expect no more problems
> because of this.
>
> A migration script is added to cleanup the 'container' relation.
>
> diff --git a/cubicweb_saem_ref/migration/0.15.1_Any.py b/cubicweb_saem_ref/migration/0.15.1_Any.py
> --- a/cubicweb_saem_ref/migration/0.15.1_Any.py
> +++ b/cubicweb_saem_ref/migration/0.15.1_Any.py
> @@ -1,2 +1,8 @@
>  for ertype in ('generated', 'used', 'associated_with', 'place_address'):
>      sync_schema_props_perms(ertype)
> +
> +
> +sql("DELETE FROM container_relation AS cr WHERE EXISTS("
> +    "SELECT FROM entities WHERE eid_to=eid AND "
> +    "type IN ('AuthorityRecord', 'ConceptScheme', 'Concept'))")

I don't understand the "AS cr". Also why doing this in SQL instead of
RQL? I don't even know if this is enough...

> +commit()



More information about the saem-devel mailing list