[PATCH 2 of 5 saem_ref] Only allow a Concept to be in one ConceptScheme

Denis Laxalde denis.laxalde at logilab.fr
Wed Feb 14 17:26:09 CET 2018


# HG changeset patch
# User Denis Laxalde <denis.laxalde at logilab.fr>
# Date 1518445776 -3600
#      Mon Feb 12 15:29:36 2018 +0100
# Node ID 9f222afb9e9f2e5feb6d54e4b6a2a539806722c1
# Parent  0273830a2ec4013b37fd95b6499e32f1686e1c6e
# Available At http://hg.logilab.org/review/cubes/saem_ref
#              hg pull http://hg.logilab.org/review/cubes/saem_ref -r 9f222afb9e9f
# EXP-Topic ark/qualifiers
Only allow a Concept to be in one ConceptScheme

See extranet #46881387 for details: we want to identify Concept using
ARK identifiers built from their respective scheme ARK identifier using
a qualifier mechanism. For this, a Concept cannot live in more than one
scheme.

diff --git a/cubicweb_saem_ref/schema.py b/cubicweb_saem_ref/schema.py
--- a/cubicweb_saem_ref/schema.py
+++ b/cubicweb_saem_ref/schema.py
@@ -136,6 +136,8 @@ make_workflowable(skos.ConceptScheme)
 publication_permissions(skos.ConceptScheme, groups=('managers',))
 skos.ConceptScheme.__permissions__['add'] = ('managers',)
 
+skos.in_scheme.cardinality = '1*'
+
 
 class Organization(EntityType):
     __permissions__ = {



More information about the saem-devel mailing list