248 rql = 'SET %s %s %s WHERE X eid %%(x)s, Y eid %%(y)s' % ( |
248 rql = 'SET %s %s %s WHERE X eid %%(x)s, Y eid %%(y)s' % ( |
249 subjvar, rschema, objvar) |
249 subjvar, rschema, objvar) |
250 for reid in seteids: |
250 for reid in seteids: |
251 self.relations_rql.append((rql, {'x': eid, 'y': reid}, ('x', 'y'))) |
251 self.relations_rql.append((rql, {'x': eid, 'y': reid}, ('x', 'y'))) |
252 |
252 |
|
253 def delete_entities(self, eidtypes): |
|
254 """delete entities from the repository""" |
|
255 redirect_info = set() |
|
256 eidtypes = tuple(eidtypes) |
|
257 for eid, etype in eidtypes: |
|
258 entity = self._cw.entity_from_eid(eid, etype) |
|
259 path, params = entity.after_deletion_path() |
|
260 redirect_info.add( (path, tuple(params.iteritems())) ) |
|
261 entity.delete() |
|
262 if len(redirect_info) > 1: |
|
263 # In the face of ambiguity, refuse the temptation to guess. |
|
264 self._after_deletion_path = 'view', () |
|
265 else: |
|
266 self._after_deletion_path = iter(redirect_info).next() |
|
267 if len(eidtypes) > 1: |
|
268 self._cw.set_message(self._cw._('entities deleted')) |
|
269 else: |
|
270 self._cw.set_message(self._cw._('entity deleted')) |
|
271 |
253 def _action_apply(self): |
272 def _action_apply(self): |
254 self._default_publish() |
273 self._default_publish() |
255 self.reset() |
274 self.reset() |
256 |
275 |
257 def _action_cancel(self): |
276 def _action_cancel(self): |