# HG changeset patch # User Sylvain Thénault # Date 1297184423 -3600 # Node ID cb6314b09e0f306f531e5383038dafbfbb105e93 # Parent 8a17e6e34f0f9cd14974d2ea41c2798eef51bb88 [schema, ui] fix is_subobject to skip cw_source relation (else everything is considered as a subobject, since this relation is now composite) diff -r 8a17e6e34f0f -r cb6314b09e0f __pkginfo__.py --- a/__pkginfo__.py Tue Feb 08 14:18:18 2011 +0100 +++ b/__pkginfo__.py Tue Feb 08 18:00:23 2011 +0100 @@ -43,7 +43,7 @@ 'logilab-common': '>= 0.54.0', 'logilab-mtconverter': '>= 0.8.0', 'rql': '>= 0.28.0', - 'yams': '>= 0.30.1', + 'yams': '>= 0.30.4', 'docutils': '>= 0.6', #gettext # for xgettext, msgcat, etc... # web dependancies diff -r 8a17e6e34f0f -r cb6314b09e0f debian/control --- a/debian/control Tue Feb 08 14:18:18 2011 +0100 +++ b/debian/control Tue Feb 08 18:00:23 2011 +0100 @@ -97,7 +97,7 @@ Package: cubicweb-common Architecture: all XB-Python-Version: ${python:Versions} -Depends: ${misc:Depends}, ${python:Depends}, graphviz, gettext, python-logilab-mtconverter (>= 0.8.0), python-logilab-common (>= 0.54.0), python-yams (>= 0.30.1), python-rql (>= 0.28.0), python-lxml +Depends: ${misc:Depends}, ${python:Depends}, graphviz, gettext, python-logilab-mtconverter (>= 0.8.0), python-logilab-common (>= 0.54.0), python-yams (>= 0.30.4), python-rql (>= 0.28.0), python-lxml Recommends: python-simpletal (>= 4.0), python-crypto Conflicts: cubicweb-core Replaces: cubicweb-core diff -r 8a17e6e34f0f -r cb6314b09e0f schema.py --- a/schema.py Tue Feb 08 14:18:18 2011 +0100 +++ b/schema.py Tue Feb 08 18:00:23 2011 +0100 @@ -65,6 +65,8 @@ NO_I18NCONTEXT = META_RTYPES | WORKFLOW_RTYPES NO_I18NCONTEXT.add('require_permission') +SKIP_COMPOSITE_RELS = [('cw_source', 'subject')] + # set of entity and relation types used to build the schema SCHEMA_TYPES = set(( 'CWEType', 'CWRType', 'CWAttribute', 'CWRelation', @@ -368,6 +370,14 @@ msg = "can't use RRQLExpression on %s, use an ERQLExpression" raise BadSchemaDefinition(msg % self.type) + def is_subobject(self, strict=False, skiprels=None): + if skiprels is None: + skiprels = SKIP_COMPOSITE_RELS + else: + skiprels += SKIP_COMPOSITE_RELS + return super(CubicWebEntitySchema, self).is_subobject(strict, + skiprels=skiprels) + def attribute_definitions(self): """return an iterator on attribute definitions