equal
deleted
inserted
replaced
156 # XXX remove aggregat from having |
156 # XXX remove aggregat from having |
157 # selection: only vocabulary entity |
157 # selection: only vocabulary entity |
158 for term in select.selection[:]: |
158 for term in select.selection[:]: |
159 select.remove_selected(term) |
159 select.remove_selected(term) |
160 # remove unbound variables which only have some type restriction |
160 # remove unbound variables which only have some type restriction |
161 for dvar in list(select.defined_vars.itervalues()): |
161 for dvar in list(select.defined_vars.values()): |
162 if not (dvar is filtered_variable or dvar.stinfo['relations']): |
162 if not (dvar is filtered_variable or dvar.stinfo['relations']): |
163 select.undefine_variable(dvar) |
163 select.undefine_variable(dvar) |
164 # global tree config: DISTINCT, LIMIT, OFFSET |
164 # global tree config: DISTINCT, LIMIT, OFFSET |
165 select.set_distinct(True) |
165 select.set_distinct(True) |
166 |
166 |
305 return None |
305 return None |
306 if rel.optional in (opt, 'both'): |
306 if rel.optional in (opt, 'both'): |
307 # optional relation |
307 # optional relation |
308 return ovar |
308 return ovar |
309 if all(rdef.cardinality[cardidx] in '1+' |
309 if all(rdef.cardinality[cardidx] in '1+' |
310 for rdef in rschema.rdefs.itervalues()): |
310 for rdef in rschema.rdefs.values()): |
311 # mandatory relation without any restriction on the other variable |
311 # mandatory relation without any restriction on the other variable |
312 for orel in ovar.stinfo['relations']: |
312 for orel in ovar.stinfo['relations']: |
313 if rel is orel: |
313 if rel is orel: |
314 continue |
314 continue |
315 if _may_be_removed(orel, schema, ovar) is None: |
315 if _may_be_removed(orel, schema, ovar) is None: |
808 |
808 |
809 def _iter_rdefs(self): |
809 def _iter_rdefs(self): |
810 rschema = self._cw.vreg.schema.rschema(self.rtype) |
810 rschema = self._cw.vreg.schema.rschema(self.rtype) |
811 # XXX when called via ajax, no rset to compute possible types |
811 # XXX when called via ajax, no rset to compute possible types |
812 possibletypes = self.cw_rset and self.cw_rset.column_types(0) |
812 possibletypes = self.cw_rset and self.cw_rset.column_types(0) |
813 for rdef in rschema.rdefs.itervalues(): |
813 for rdef in rschema.rdefs.values(): |
814 if possibletypes is not None: |
814 if possibletypes is not None: |
815 if self.role == 'subject': |
815 if self.role == 'subject': |
816 if rdef.subject not in possibletypes: |
816 if rdef.subject not in possibletypes: |
817 continue |
817 continue |
818 elif rdef.object not in possibletypes: |
818 elif rdef.object not in possibletypes: |