252 card = rschema.rproperty(eschema, desttype, 'cardinality')[0] |
252 card = rschema.rproperty(eschema, desttype, 'cardinality')[0] |
253 if card not in '?1': |
253 if card not in '?1': |
254 selection.pop() |
254 selection.pop() |
255 restrictions.pop() |
255 restrictions.pop() |
256 continue |
256 continue |
257 if card == '?': |
257 # XXX we need outer join in case the relation is not mandatory |
258 restrictions[-1] += '?' # left outer join if not mandatory |
258 # (card == '?') *or if the entity is being added*, since in |
|
259 # that case the relation may still be missing. As we miss this |
|
260 # later information here, systematically add it. |
|
261 restrictions[-1] += '?' |
259 destcls = cls.vreg['etypes'].etype_class(desttype) |
262 destcls = cls.vreg['etypes'].etype_class(desttype) |
260 destcls._fetch_restrictions(var, varmaker, destcls.fetch_attrs, |
263 destcls._fetch_restrictions(var, varmaker, destcls.fetch_attrs, |
261 selection, orderby, restrictions, |
264 selection, orderby, restrictions, |
262 user, ordermethod, visited=visited) |
265 user, ordermethod, visited=visited) |
263 orderterm = getattr(cls, ordermethod)(attr, var) |
266 orderterm = getattr(cls, ordermethod)(attr, var) |