[PATCH 1 of 1 eac] [migration] Add missing bits of migration

Sylvain Thénault sylvain.thenault at logilab.fr
Thu Mar 9 11:00:30 CET 2017



Le 09/03/2017 à 10:29, Denis Laxalde a écrit :
> Sylvain Thenault a écrit :
>> # HG changeset patch
>> # User Sylvain Thénault <sylvain.thenault at logilab.fr>
>> # Date 1489011066 -3600
>> #      Wed Mar 08 23:11:06 2017 +0100
>> # Node ID 5507b0f1f5f210f05a3c5c06251217b812769cc7
>> # Parent  22b591ad3be1570a5104add188131ff489bf2460
>> [migration] Add missing bits of migration
>>
>> ensure permissions of relation impacted by 22b591ad3be1 are synced.
>>
>> diff --git a/cubicweb_eac/migration/0.5.0_Any.py
>> b/cubicweb_eac/migration/0.5.0_Any.py
>> --- a/cubicweb_eac/migration/0.5.0_Any.py
>> +++ b/cubicweb_eac/migration/0.5.0_Any.py
>> @@ -1,1 +1,14 @@
>> +from cubicweb_compound import utils
>> +from cubicweb_eac import AuthorityRecordGraph
>> +
>>  add_cube('compound')
>> +
>> +graph = AuthorityRecordGraph(schema)
>> +structure = graph.parent_structure('ConceptScheme')
>
> ConceptScheme?
fixed
>
>> +
>> +optionals = utils.optional_relations(schema, structure)
>> +for child, relations in structure.iteritems():
>> +    sync_schema_props_perms(child, syncprops=False)
>
> "relations" is not used so "for child in structure:"
fixed
>
>> +for rdef, parent_role in utils.mandatory_rdefs(schema, structure):
>> +    sync_schema_props_perms((rdef.subject, rdef.rtype, rdef.object),
>> syncprops=False)
>>
>
> It looks like we're missing a sync_graph_schema_props_perms function in
> cubicweb_compount.utils.
>
no that easy to access migration function from a simple cube function.
Not sure it's worth it to avoid 2 lines of code, I would like to
postpone that.


-- 
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
CubicWeb, the semantic web framework:    http://www.cubicweb.org



More information about the saem-devel mailing list