# HG changeset patch # User Sylvain Thénault # Date 1250499928 -7200 # Node ID 83c5499e1436036ede65973a30b6e0d11878d92e # Parent e3a5b7c3f7675c2aab474bf0a89af598eeb19f5c [entity] fix fetch_rql w/ case where it's called while entity is not 'complete' (eg time where it's being added but have not yet all mandatory relations set) diff -r e3a5b7c3f767 -r 83c5499e1436 entity.py --- a/entity.py Mon Aug 17 10:31:28 2009 +0200 +++ b/entity.py Mon Aug 17 11:05:28 2009 +0200 @@ -254,8 +254,11 @@ selection.pop() restrictions.pop() continue - if card == '?': - restrictions[-1] += '?' # left outer join if not mandatory + # XXX we need outer join in case the relation is not mandatory + # (card == '?') *or if the entity is being added*, since in + # that case the relation may still be missing. As we miss this + # later information here, systematically add it. + restrictions[-1] += '?' destcls = cls.vreg['etypes'].etype_class(desttype) destcls._fetch_restrictions(var, varmaker, destcls.fetch_attrs, selection, orderby, restrictions,