Commit 4c134273 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

[entity/rset] replace scary warnings about ambiguous rdefs by XXX in the code

users can't do anything about that and shouldn't see those warnings.
parent bb719d857421
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of CubicWeb.
......@@ -344,7 +344,8 @@ class Entity(AppObject):
cls.warning('skipping fetch_attr %s defined in %s (not found in schema)',
attr, cls.__regid__)
continue
rdef = eschema.rdef(attr)
# XXX takefirst=True to remove warning triggered by ambiguous inlined relations
rdef = eschema.rdef(attr, takefirst=True)
if not user.matching_groups(rdef.get_groups('read')):
continue
if rschema.final or rdef.cardinality[0] in '?1':
......@@ -793,8 +794,9 @@ class Entity(AppObject):
# skip already defined relations
if getattr(self, rschema.type):
continue
# XXX takefirst=True to remove warning triggered by ambiguous relations
rdef = self.e_schema.rdef(rschema, takefirst=True)
# skip composite relation
rdef = self.e_schema.rdef(rschema)
if rdef.composite:
continue
# skip relation with card in ?1 else we either change the copied
......@@ -813,7 +815,8 @@ class Entity(AppObject):
continue
if rschema.type in skip_copy_for['object']:
continue
rdef = self.e_schema.rdef(rschema, 'object')
# XXX takefirst=True to remove warning triggered by ambiguous relations
rdef = self.e_schema.rdef(rschema, 'object', takefirst=True)
# skip composite relation
if rdef.composite:
continue
......
......@@ -541,7 +541,8 @@ class ResultSet(object):
else:
attr_cols[attr] = i
else:
rdef = eschema.rdef(attr, role)
# XXX takefirst=True to remove warning triggered by ambiguous relations
rdef = eschema.rdef(attr, role, takefirst=True)
# only keep value if it can't be multivalued
if rdef.role_cardinality(role) in '1?':
rel_cols[(attr, role)] = i
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment